androidStudio升级到2.3之后新建Activity布局变成了约束(ConstraintLayout)布局

来源:互联网 发布:2017学校网络改造方案 编辑:程序博客网 时间:2024/06/06 02:21

1.如上图,as升级到2.3之后,新建布局默认变成了约束布局

2.在as安装目录\plugins\android\lib\templates\activities\common\root\res\layout下,找到simple.xml.ftl文件

3.用以下布局替换

<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/hello_world"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />


</RelativeLayout>

4.重启as,大公告成!

1 0