簡體   English   中英

關於在an​​droid中的xml文件中左側和右側放置2個按鈕

[英]regarding placing 2 buttons on the left and right side in an xml file in android

我正在開發一個應用程序。我在后面和項目中有2個按鈕。我想在按鈕下方放置一個列表。我該如何在xml文件中執行此操作?有人可以告訴我...

嘗試以下代碼

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 
        android:id="@+id/LinearLayout01" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:orientation="vertical"
        xmlns:android="http://schemas.android.com/apk/res/android" android:background="@drawable/background">

<LinearLayout
android:id="@+id/LinearLayoutIcons" 
     android:layout_height="wrap_content" android:layout_width="fill_parent" android:gravity="center_horizontal">



<Button android:text="@+id/Button01" android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button><Button android:text="@+id/Button02" android:id="@+id/Button02" android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>



</LinearLayout>






<ListView
android:id="@+id/ListViewMessage" 
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    </ListView>
    </LinearLayout>

如果要在Button01下面對齊列表視圖

嘗試

android:layout_below="@+id/Button01"

在ListView中

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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