是否可以以编程方式更改视图外观顺序?
例子。
<EditText
android:id="@+id/edit_txt_address_location_street"
android:layout_width="0dip"
android:layout_height="36dp"
android:layout_marginBottom="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="8dp"
android:layout_weight="8"
android:background="@drawable/shape_edit_text"
android:inputType="textNoSuggestions"
android:textColor="@color/black"
android:textCursorDrawable="@null" />
<EditText
android:id="@+id/edit_txt_address_location_street_nr"
android:layout_width="0dip"
android:layout_height="36dp"
android:layout_marginBottom="4dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:layout_marginTop="8dp"
android:layout_weight="2"
android:background="@drawable/shape_edit_text"
android:inputType="textNoSuggestions"
android:textColor="@color/black"
android:textCursorDrawable="@null" />
关于显示正常外观顺序的xml。
1. edit_txt_address_location_street
2. edit_txt_address_location_street_nr
对于某些情况,我必须以编程方式反转外观顺序。例如:
1. edit_txt_address_location_street_nr
2. edit_txt_address_location_street