將Android Studio默認布局ConstraintLayout切換成LinearLayout
找到安裝AS路徑:
Android Studio\plugins\android\lib\templates\activities\common\root\res\layout
下面的simple.xml.ftl文件用記事本打開
上面顯示為扁平化布局的默認代碼,要將其修改為線性布局
將所有代碼改成:
1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout 3 xmlns:android="http://schemas.android.com/apk/res/android" 4 xmlns:app="http://schemas.android.com/apk/res-auto" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent"> 7 8 <TextView 9 android:layout_width="wrap_content" 10 android:layout_height="wrap_content" 11 android:text="Hello World!" 12 /> 13 14 15 </LinearLayout>
重開AS即可
