我正在使用Android Studio 3.5,但在以前的版本中也遇到了此问题。
在大多数情况下,当我更改布局视图中的属性或重新排列元素时,子组件的顺序会弄乱,因此我不得不再次手动对其进行排序。有时,新顺序按ID字母顺序排列,有时似乎是随机的。我不知道为什么会发生这种情况,而且我也没有在线找到任何帮助,但这很令人讨厌。
对于可以尝试的内容或可以更改的设置的任何提示或建议,我将不胜感激。
<ScrollView
android:id="@+id/formatd_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadeScrollbars="false">
<RadioGroup
android:id="@+id/formatd_format_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="16dp"
android:paddingTop="8dp"
android:paddingEnd="16dp"
android:paddingBottom="8dp">
<TextView
android:id="@+id/textView7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Audio"
android:textAllCaps="true"
android:textColor="@color/colorOnSecondary"
android:textSize="14sp" />
<RadioButton
android:id="@+id/format_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp3" />
<RadioButton
android:id="@+id/format_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="m4a" />
<RadioButton
android:id="@+id/format_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="webm" />
<TextView
android:id="@+id/textView8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Video"
android:textAllCaps="true"
android:textColor="@color/colorOnSecondary"
android:textSize="14sp" />
<RadioButton
android:id="@+id/format_4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp4 (360p)" />
<RadioButton
android:id="@+id/format_5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp4 (480p)" />
<RadioButton
android:id="@+id/format_6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp4 (720p)" />
<RadioButton
android:id="@+id/format_7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp4 (1080p)" />
<RadioButton
android:id="@+id/format_8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="mp4 (1440p)" />
<RadioButton
android:id="@+id/format_9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="webm (4K)" />
<RadioButton
android:id="@+id/format_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="webm (8K)" />
</RadioGroup>
</ScrollView>
例如,如果我编辑formatd_content的属性,或者如果我在布局编辑器中将formatd_content移到另一个视图(拖放),则formatd_format_group中的所有内容将变得无序。
应注意,此问题仅适用于通过布局编辑器完成的更改,而不是直接应用于xml。