嗨我有FrameLayout
並且想在此佈局中添加two buttons (or more)
。
第一個按鈕顯示,但是當添加第二個按鈕時,似乎將it beneath the first button
。我試過margin top gravity
和其他幾個,但似乎無法顯示第一個下面的按鈕。如何在framelayout中顯示彼此之下的按鈕?
這裏是我的XML文件
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/logo1">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" >
<Button
android:id="@+id/Distancecalc"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Distance Calculator" />
<Button
android:id="@+id/Distance"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Distance Calculator" />
</FrameLayout>
</LinearLayout>
</TabHost>
誰能請幫助?
十分感謝!有用! – Allrounder 2014-11-14 13:11:18