zoukankan      html  css  js  c++  java
  • Android Studio 新建项目默认布局修改

    我的安装地址:E:AndroidAndroid Studiopluginsandroidlib emplatesactivitiescommon oot eslayout

    备份simole.xml.ftl文件,然后打开原文件

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.constraint.ConstraintLayout
        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 hasAppBar && appBarLayoutName??>
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        tools:showIn="@layout/${appBarLayoutName}"
    </#if>
        tools:context="${relativePackage}.${activityClass}">
    
    <#if isNewProject!false>
        <TextView
    <#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>
    </android.support.constraint.ConstraintLayout>

    没错这就是ConstraintLayout的布局文件,只不过有一些条件判定,我们无视它,直接改成LinearLayout的布局代码

    <?xml version="1.0" encoding="utf-8"?>
    
        <LinearLayout  
            xmlns:android="http://schemas.android.com/apk/res/android"  
            android:orientation="vertical"
            android:layout_width="match_parent"  
            android:layout_height="match_parent">  
          
            <TextView  
                android:layout_width="wrap_content"  
                android:layout_height="wrap_content"  
                android:text="Hello World!"  
            />  
          
          
        </LinearLayout>  

    新建项目:

  • 相关阅读:
    require() 源码解读
    那些JS容易忽略的题
    javascript:void(0);与return false
    location.href
    IE CSS Bugs 列表和解决方法
    npm 常用命令
    移动开发不能不知道的事-meta
    Canvas介绍
    用CSS变形创建圆形导航
    一个传统行业互联网系统的架构演化(Week 4)
  • 原文地址:https://www.cnblogs.com/xinyibufang/p/7263116.html
Copyright © 2011-2022 走看看