每次創建新的工程后,布局文件的的布局總是ConstraintLayout,如何更改?
進入Android Studio安裝目錄,用文本編輯器打開文件plugins\android\lib\templates\activities\common\root\res\layout\simple.xml.ftl
將文件內容修改為
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"><TextViewandroid:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="Hello World" /> </LinearLayout>
保存更改,以后創建的新工程里的默認布局就是LinearLayout