线性布局练习
16lz
2021-01-23
<?xml version="1.0" encoding="utf-8"?><LinearLayout 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" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:id="@+id/ll_1" android:layout_width="200dp" android:layout_height="200dp" android:background="#000000" android:orientation="vertical" android:padding="20dp"> <View android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF0033"/> LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" android:background="#ccff99" android:layout_marginTop="20dp" android:layout_marginLeft="15dp" android:layout_marginRight="15dp" android:gravity="center"> <View android:layout_width="50dp" android:layout_height="50dp" android:background="#ffffff"/> LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="100dp" android:orientation="horizontal" android:background="#ccff99" android:layout_marginTop="20dp" android:layout_marginLeft="15dp" android:layout_marginRight="15dp"> <View android:layout_width="0dp" android:layout_height="50dp" android:background="#000000" android:layout_weight="1" /> <View android:layout_width="0dp" android:layout_height="50dp" android:background="#FF0033" android:layout_weight="1"/> LinearLayout>LinearLayout>
更多相关文章
- Android下QQ空间查看大图特效
- 【Android UI设计与开发】第09期:底部菜单栏(四)Fragment+PopupWind
- Android为Layout设置最大宽度
- Android获取屏幕的高度和宽度
- android之4.0控件switch自定义开关背景图片和控制宽度
- 更改系统给APP应用分配最大的内存空间
- android获取控件宽度
- android之获取手机安装包里面的信息、获取目录空间的大小