[英]How to create this layout in Android
我在玩Mono Droid并尝试实现以下布局
我将使用哪种类型的布局? Android中是否有诸如锚点和停靠之类的东西(如WinForms),这样在某种程度上可以是独立的?
这仅适用于平板电脑,更多用于我的实验。 左面板内部的按钮将重复。
谢谢。
根布局将如下所示:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="5dp" >
<RelativeLayout
android:id="@+id/leftContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0.8" >
</RelativeLayout>
<RelativeLayout
android:id="@+id/rightContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:padding="20dp" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="btn1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="btn2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:text="btn3" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
在“左右布局”顶部的ListView中添加动态项。
线性布局将正常工作..您可以指定要捕获的空间的权重。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.