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>
相关推荐
x***13393 小时前
【MyBatisPlus】MyBatisPlus介绍与使用
android·前端·后端
n***54384 小时前
【MySQL】MySQL内置函数--日期函数字符串函数数学函数其他相关函数
android·mysql·adb
z***75155 小时前
【Springboot3+vue3】从零到一搭建Springboot3+vue3前后端分离项目之后端环境搭建
android·前端·后端
程序员陆业聪5 小时前
Android模拟器检测全面指南:从基础到高级策略
android
likuolei5 小时前
Eclipse 快捷键
java·ide·eclipse
2501_916008897 小时前
iOS 性能测试的深度实战方法 构建从底层指标到真实场景回放的多工具测试体系
android·ios·小程序·https·uni-app·iphone·webview
w***95497 小时前
SQL美化器:sql-beautify安装与配置完全指南
android·前端·后端
r***12387 小时前
若依微服务中配置 MySQL + DM 多数据源
android·mysql·微服务
ALex_zry8 小时前
MySQL连接数管理与优化实操经验分享
android·mysql·adb
努力成为大牛吧9 小时前
Pycharm 接入 Deepseek API完整版教程
ide·python·pycharm