2012-01-13 47 views
0

我將超過15個按鈕放在一個.xml文件中。但它似乎只是顯示其中前9名?爲什麼不顯示其他按鈕或不能向下滾動查看它們?Android佈局是否已修復?

我正在使用帶標籤的LinearLayout。

+0

您使用哪種佈局? – Ghost 2012-01-13 09:51:19

+0

請粘貼您的XML,以便我們提供幫助。 – 2012-01-13 09:51:48

+0

使用LinearLayout和

回答

2

你使用它?

android:orientation="vertical" 

請發表您的代碼,

+0

<的LinearLayout 的xmlns:機器人= 「http://schemas.android.com/apk/res/android」 機器人:取向= 「垂直」 機器人:layout_width = 「match_parent」 機器人:layout_height = 「match_parent」 機器人:背景= 「@繪製/ BG」> \t <按鈕 機器人:layout_width = 「match_parent」 機器人:ID = 「@ + ID/badrul」 機器人:文本= 「Badrul鬆革蠟染」 機器人:layout_height = 「wrap_content」 android:layout_alignParentTop =「true」 android:layout_centerHorizo​​ntal =「true」> 無法列出所有的按鍵代碼,空間不足。 – 2012-01-13 12:24:44

+0

看來你已經得到了正確的答案。恭喜! – peanut 2012-01-13 16:40:30

+0

謝謝!是的,我做過 – 2012-01-14 05:10:34

3

您是否使用了LinearLayout也許包含的按鈕?或者ScrollView中沒有包含的任何其他佈局?很可能你的按鈕被繪製出來,它們就在屏幕之外。

包裝你的佈局在ScrollView像這樣:

<ScrollView 
      android:id="@+id/scrollView1" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:fillViewport="true" 
      android:scrollbars="none" > 

      <LinearLayout 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:orientation="vertical" > 

       <!-- your buttons here --> 
      </LinearLayout> 
     </ScrollView> 

這使得佈局滾動的,所以你可以只向下滾動,看到你的按鈕。

+0

哦,是的,這對我有用。感謝您指出! – 2012-01-13 12:47:20