This article describes the usage of resource files in Android. Share it for your reference, as follows:
1. Use of resource files between XML files
Quote format:
attribute="@[packagename:]resourcetype/resourceidentifier"
example:
There are, files, use the parameters in them
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:andro android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="@dimen/standard_border"> <EditText android: android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/stop_message" android:textColor="@color/opaque_blue" /> </LinearLayout>
2. Use system resources
Use Android local system resources to write this:
How to use it in XML files:
<EditText android: android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@android:string/httpErrorBadUrl" android:textColor="@android:color/darker_gray" />
Note that when referring to local resources, the prefix of android is added.
For more information about Android related content, please check out the topic of this site:Android resource operation skills summary》、《Android file operation skills summary》、《Summary of Android's SQLite database skills》、《Summary of Android operating json format data skills》、《Android database operation skills summary》、《Android programming activity operation skills summary》、《A summary of SD card operation methods for Android programming and development》、《Android development introduction and advanced tutorial》、《Android View View Tips Summary"and"Android control usage summary》
I hope this article will be helpful to everyone's Android programming design.