Android Studio修改创建新布局时默认根布局

将Android Studio默认布局ConstraintLayout切换成LinearLayout

打开设置, Editor> File and Code Templates > Other > layoutResourceFile.xml

备注:创建时提示根布局仍然为ConstraintLayout,不用管这个,实际创建的是根据模板来的

示例模板

复制代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">
    
    <
    
</LinearLayout>
相关推荐
harry235day4 分钟前
Compose 带动画的待办清单列表页
android·android jetpack
vocal4 分钟前
我的安卓第一课:四大组件之一Activity及其组件RecyclerView
android
love530love20 分钟前
【PyCharm必会基础】正确移除解释器及虚拟环境(以 Poetry 为例 )
开发语言·ide·windows·笔记·python·pycharm
咕噜企业签名分发-淼淼29 分钟前
如何实现安卓端与苹果端互通的多种方案
android
wu_android1 小时前
Android 线性布局中常见的冲突属性总结
android
恋猫de小郭1 小时前
为什么跨平台框架可以适配鸿蒙,它们的技术原理是什么?
android·前端·flutter
张风捷特烈3 小时前
每日一题 Flutter#5,6 | 两道 Widget 选择题
android·flutter
*Lisen3 小时前
重新安装解决mac vscode点击不能跳转问题
ide·vscode·macos
移动开发者1号3 小时前
App主界面点击与跳转启动方式区别
android·kotlin
移动开发者1号3 小时前
我用Intent传大图片时竟然崩了,怎么回事啊
android·kotlin