安卓studio默認使用ConstraintLayout

發現一個小問題,關於studio的:
 現在用的是最新的版本,因爲studio的特性,在創建新的activity的時候會幫我們創建默認的layout佈局文件(如果我們不點擊取消的話),而默認的額2.3.1的版本會使用ConstraintLayout。

而studio會自動下載ConstraintLayout依賴。

---------------------------------------------------------

解決辦法:

修改:C:\Program Files\Android\Android Studio\plugins\android\lib\templates\activities\common\root\res\layout

目錄下的simple.xml.ftl文件爲一下內容:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="${relativePackage}.${activityClass}">


    <TextView
        android:text="@string/app_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


</RelativeLayout>


發佈了40 篇原創文章 · 獲贊 17 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章