2012-10-27 64 views
1

这是我的代码,我尝试了很多方法来设置按钮相邻,但他们没有工作。将按钮放在一起

我真的会赞赏你的帮助。

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



     <Button 
      android:id="@+id/button1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" 
      android:layout_alignParentLeft="true" /> 

     <Button 
      android:id="@+id/button2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_weight="1" /> 

</LinearLayout> 
+0

请做它android:orientation =“horizo​​ntal” –

+0

除非您更精确地定义'next next',否则这是无法回答的问题 – NickT

+0

以及您在布局中所做的一切以及需要并排排列的所有东西吗? –

回答

2

变化的android:方向= “垂直” 到Android:方向= “横向”

+0

我知道这种方式,但它不起作用,因为我有文本字段和文本视图 – ZiZo

+0

请说明更多。并给我们整个代码 –

+0

哦,没关系,谢谢你我只是用线性布局分开两个按钮:) – ZiZo

0

你可以通过改变机器人通过实现这一目标:定位= “垂直” 到Android:方向= “横向”。如果您发布了您的用户界面模式,那么我可以更精确地帮助您,谢谢。