2
复选框文本不上取向的变化而变化复选框文本不会更改的取向变化
我有不同的布局文件(一个在布局和一个布局,土地)的屏幕,唯一的区别是,一些UI文件中的小部件指向不同的字符串(横向模式的较长字符串)。对于TextView小部件,将显示正确的资源字符串,但对于CheckBox,显示的文本在所有方向更改期间保持不变。
./layout/tabA.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/label1"
style="@style/TextBoxLabel.Header.WithInputsOnScreen"
android:text="@string/label1Short"
/>
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:layout_below="@id/label1"
android:text="@string/checkBox1Short"
/>
</RelativeLayout>
</ScrollView>
./layout-land/tabA.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/label1"
style="@style/TextBoxLabel.Header.WithInputsOnScreen"
android:text="@string/label1Long"
/>
<CheckBox
android:id="@+id/checkBox1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:layout_below="@id/label1"
android:text="@string/checkBox1Long"
/>
</RelativeLayout>
</ScrollView>
因此,与上述上label1Short和label1Long之间的方位变化label1的文本改变。但checkBox1的文本与第一次查看屏幕时设备方向正确的文本保持一致。
有什么想法?谢谢 迈克