布局中使用权重对齐问题

来源:互联网 发布:java中tcp和udp的区别 编辑:程序博客网 时间:2024/05/22 06:53
   <LinearLayout            android:layout_marginTop="10dp"            android:orientation="horizontal"            android:layout_width="match_parent"            android:layout_height="wrap_content">            <TextView                android:layout_width="match_parent"                android:layout_weight="2"                android:layout_height="wrap_content"                android:text="序列号"                android:layout_marginLeft="25dp"                android:textSize="15dp"                android:textColor="@color/gray"                />            <TextView                android:layout_width="match_parent"                android:layout_weight="1"                android:layout_height="wrap_content"                android:text="1"                android:textSize="18dp"                android:layout_marginLeft="30dp"                />        </LinearLayout>        <LinearLayout            android:layout_marginTop="10dp"            android:orientation="horizontal"            android:layout_width="match_parent"            android:layout_height="wrap_content">            <TextView                android:layout_width="match_parent"                android:layout_weight="2"                android:layout_height="wrap_content"                android:text="总节数"                android:layout_marginLeft="25dp"                android:textSize="15dp"                android:textColor="@color/gray"                />            <TextView                android:layout_width="match_parent"                android:layout_weight="1"                android:layout_height="wrap_content"                android:text="50"                android:textSize="18dp"                android:layout_marginLeft="30dp"                />        </LinearLayout>


0 0
原创粉丝点击