谷歌发布新版本的androidStudio之后 一直力推ConstraintLayout 布局
但是对于不喜欢用的人来说就有点麻烦了 每次都要手动更改 嘻嘻 这个其实是可以修改的
首先打开androidStudio的安装目录 ,我的是E:\Application\androidStudio
进入之后,进入到以下文件夹\plugins\android\lib\templates\activities\common\root\res\layout,如图所示:
用编辑器打开simple.xml.ftl
然后把这个粘贴进去就可以了,当然你喜欢相对布局的话 可以自行修改
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
/>
</LinearLayout>