zoukankan      html  css  js  c++  java
  • Android 笔记一:线性布局

    建立布局

    新建项目后,在如图路径下新建xml文件可以开始编辑

    weight的使用

    android:layout_width="0dp",或android:layout_width="wrap_content"
    之后在设置layout_weight即可

    
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
            xmlns:tools="http://schemas.android.com/tools"
            android:id="@+id/LinearLayout1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="horizontal">
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:background="#ADFF2F"
                android:layout_weight="1"/>
    
    
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="fill_parent"
                android:background="#DA70D6"
                android:layout_weight="1"/>
    
        </LinearLayout>
    

    效果如图:

    android:layout_width="wrap_content"

    同上

  • 相关阅读:
    SimpleXML简单使用
    制作RSS供应源
    DOM方式操作XML
    Referer与图片防盗链
    PAT
    Margarite and the best present
    Petya and Origami
    Margarite and the best present
    Petya and Origami
    A/B
  • 原文地址:https://www.cnblogs.com/YuQiao0303/p/9804523.html
Copyright © 2011-2022 走看看