• Android Studio 线性布局


    一、UI插件

    1、布局管理器

    (1)线性布局(LinearLayout)

    (2)相对布局(RelativeLayout)

    二、线性布局

    1、最常用属性

     

    复制代码
    <?xml version="1.0" encoding="utf-8"?>
    <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".MainActivity">
    
        <LinearLayout
            android:id="@+id/ll_1"
            android:layout_width="195dp"
            android:layout_height="186dp"
            android:background="#000000"
            android:orientation="vertical"
            android:padding="20dp"
            tools:ignore="MissingConstraints">
    
            <View
                android:layout_height="match_parent"
                android:layout_weight="match_parent"
                android:background="#FF0033"
                android:rotationX="-6"
                android:text="Hello World!"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintHorizontal_bias="0.497"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintRight_toRightOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintVertical_bias="0.423" />
        </LinearLayout>
    </androidx.constraintlayout.widget.ConstraintLayout>
    复制代码

     

    复制代码
    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:background="#0066FF"
            android:orientation="horizontal">
            <View
                android:layout_width="50dp"
                android:layout_height="50dp"
                android:background="#ffffff"/>
        </LinearLayout>
    复制代码

    多种颜色平分界面:

    (1)

    复制代码
     <LinearLayout
            android:layout_width="300dp"
            android:layout_height="200dp"
            android:background="#0066FF"
            android:orientation="horizontal"
            tools:layout_editor_absoluteX="15dp"
            tools:layout_editor_absoluteY="15dp">
    
            <View
                android:layout_width="150dp"
                android:layout_height="match_parent"
                android:background="#ffffff" />
            <View
                android:layout_width="150dp"
                android:layout_height="match_parent"
                android:background="#FF0033" />
        </LinearLayout>
    复制代码

    (2)layout-weight权重设为1,把剩余空间按照权重去分配。

     

    复制代码
    <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="200dp"
            android:background="#0066FF"
            android:orientation="horizontal"
            tools:layout_editor_absoluteX="15dp"
            tools:layout_editor_absoluteY="15dp">
    
            <View
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:background="#000000"
                android:layout_weight="1"/>
            <View
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:background="#FF0033"
                android:layout_weight="1"/>
        </LinearLayout>
  • 相关阅读:
    (*^_^*)Pose Estimation:DensePose
    (^_^)Pose Estimation:SamplePose
    [*v*/]人脸识别任务算法RetinaFace
    [*v*/]人脸识别任务算法MTCNN
    从Winograd算法看INT8量化及卷积加速原理
    [*_*/]Darknet && Mobilnet
    从TensorRT看INT8量化原理
    SSD算法精度
    信用评分卡模型的理论准备
    分类模型评估指标
  • 原文地址:https://www.cnblogs.com/1329197745a/p/14905125.html
Copyright © 2020-2023  润新知