1、找到安装Android Studio3.5.2的路径
Android Studio\\plugins\\android\\lib\\templates\\activities\\common\\root\\res\\layout
2、将simple.xml.ftl文件,用记事本打开,内容如下:
<${getMaterialComponentName('android.support.constraint.ConstraintLayout', useAndroidX)}
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
<#if appBarLayoutName??>
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/${appBarLayoutName}"
#if>
tools:context="${packageName}.${activityClass}">
<#if isNewProject!false>
<#if includeCppSupport!false> android:id="@+id/sample_text" #if> android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="parent" /> #if> ${getMaterialComponentName('android.support.constraint.ConstraintLayout', useAndroidX)}> 3、将simple.xml.ftl文件中的代码全部删除,改为下面的代码: xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Hello World!" /> 4、重启Android Studio3.5.2即可。 推荐文章
发表评论