將Android Studio默認佈局ConstraintLayout切換成LinearLayout

將Android Studio默認佈局ConstraintLayout切換成LinearLayout

   

大部分人初次使用google android 扁平化佈局ConstraintLayout都感到不太熟悉,而Android Studio的默認佈局就是ConstraintLayout,所以想將其默認佈局改爲LinearLayout

找到安裝AS路徑:

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:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!" />

</LinearLayout>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章