如果你使用这个布局文件,而且想修改TextView的文字,需要使用这个id,使用方法如下:
Android.R.id.text1是在安卓SDK中预定义的布局文件中的控件,预定义的布局文件在Android SDK路径\platforms\android-\data\res\layout中,例如simple_list_item_activivated_1.xml,打开后发现布局文件,其中有空间TextView,定义的id为@android:id/text1.
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/activatedBackgroundIndicator"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
/>
|