我想知道安卓有没有像java中的div一样的东西
我在画页面,用的表格布局,有一列要放两个按钮,可是不知道怎么弄,
因为是新手,也不太懂,我画出来的样子:
可是我需要的是这个样子:
只要把那两个按钮放一起就可以了。
那一行我的代码:
android:id="@+id/send_notice_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#CDCDCD"
android:stretchColumns="1" >
<TextView
android:id="@+id/notice_type"
android:gravity="right"
android:padding="5dip"
android:text="通知类型:" />
<Button
android:id="@+id/meeting_notice"
android:layout_height="match_parent"
android:background="@drawable/boder"
android:text="会议通知"
android:textSize="15dip" />
<Button
android:id="@+id/leave_notice"
android:layout_height="match_parent"
android:background="@drawable/boder"
android:text="放假通知"
android:textSize="15dip" />
</TableRow>
</TableLayout>
现在只是要画出页面。
使用一个LinearLayout包着两个按钮,方向为水平方向,同时固定LinearLayout的亮度
将两个按钮按比例排列,比例1:1
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/meeting_notice"
android:layout_height="match_parent"
android:background="@drawable/boder"
android:text="会议通知"
android:textSize="15dip" />
<Button
android:id="@+id/leave_notice"
android:layout_height="match_parent"
android:background="@drawable/boder"
android:text="放假通知"
android:textSize="15dip" />
</Linearlayout>
给那2个按钮定义宽度,为自适应
我试了定义宽度是没用的。还有人告诉我直接用下拉框,也是可以的。