2012-01-13 26 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