簡體   English   中英

如何在Android中創建此布局

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM