安卓线性布局LinearLayout

XML 复制代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="横排第一个"
            android:textSize="17sp"
            android:textColor="#000000"/>

        <TextView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="横排第二个"
            android:textSize="17sp"
            android:textColor="#000000"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:text="竖排第一个"
            android:textSize="17sp"
            android:textColor="#000000"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="2"
            android:text="竖排第二个"
            android:textSize="17sp"
            android:textColor="#000000"/>

    </LinearLayout>

</LinearLayout>
相关推荐
WAsbry几秒前
深入理解 Kotlin suspend:挂起语义、状态机与恢复调度
android
WAsbry5 分钟前
Flow在Android中的完整落地:异常、重试与生命周期
android
WAsbry6 分钟前
协程共享状态:Atomic、Mutex、Semaphore与状态封闭
android
WAsbry7 分钟前
Flow执行模型:上下文保持与生产消费节奏
android
WAsbry11 分钟前
协程任务的组织方式:launch、async、withContext与结构化并发
android
WAsbry14 分钟前
本文区分原子变量、复合操作、并发数量与状态所有权四类问题,比较Atomic、Mutex、Semaphore和状态封闭的适用边界,并结合计数、缓存和限流场景,建立
android
2501_9159090631 分钟前
iOS test 测试怎么做?功能、性能、兼容、稳定与安全五类测试指南
android·ios·小程序·https·uni-app·iphone·webview
赵广陆1 小时前
企业实战:Markdown图片检索
android·java·开发语言
alexhilton2 小时前
千万别误用Android Skills
android·kotlin·android jetpack
淡淡的香烟3 小时前
Android视频直播播放器简单封装
android·物联网·音视频