首页 > 解决方案 > 如何在android中用实线划分布局?

问题描述

我必须创建一个类似于图片中的界面,但我不知道如何在linearlayouts

在此处输入图像描述

标签: androidandroid-layout

解决方案


自己调整

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

            <View
                android:layout_width="0dp"
                android:layout_height="1dp"
                android:layout_weight="1.5"
                android:background="@color/Black"></View>

            <ImageView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="0.5"
                android:src="@drawable/ic_clock"/>
            <View
                android:layout_width="0dp"
                android:layout_height="1dp"
                android:layout_weight="1.5"
                android:background="@color/Black"></View>

        </LinearLayout>

推荐阅读