發現一個小問題,關於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>