发现一个小问题,关于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>