2. 最后一行“不显示日期”的合并单元格样式
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="30" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_span="2"
android:background="#ffffff"
android:text="不显示日期" />
绝对布局指定每个控件在手机上的具体坐标,每个控件的位置和大小是固定的。由于不同手机屏幕大小可能不同,所以绝对布局只适用于固定的手机屏幕。平常用得比较少,这里就不做详细介绍了。
层布局也叫帧布局。每个控件占据一层,后面添加的层会覆盖前面的层。如果后面的层的大小大于或者等于前面的层,那么前面的层就会被完全覆盖。后面层中的控件就看不到了。实际应用中如果想要得到一个空间浮现在另一个控件的上方,可以在控件内部嵌套层布局。
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/FrameLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:foregroundGravity="right|bottom">
<TextView
android:layout_width="200dp"
android:layout_height="200dp"
android:background="#FF6143" /> //橙色
<TextView
android:layout_width="150dp"
android:layout_height="150dp"
android:background="#7BFE00" /> //绿色
<TextView
android:layout