2015-04-04 53 views
0

我需要通过添加折线来分开按钮的最佳解决方案。
我试过字符串\ n但它不工作。
它使应用程序崩溃。Android - Java&XML - 带按钮的折线

任何想法?

我试图用按钮来创建应用程序来更快地访问网站。

<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/button_so" android:text="@string/stack" android:onClick="goToSo" android:lines="1"/> 
<Button android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/superuser" android:id="@+id/button_su" android:onClick="goToSu" /> 
+0

你需要给我们比这更详细的信息!您目前正在使用的任何代码片段,您尝试过的内容,关于您想要实现的更多细节 - 给我们更多的东西来咀嚼,您的问题现在几乎没有意义。 – 2015-04-04 18:06:09

+0

真的不清楚你在问什么。 – FWeigl 2015-04-04 18:06:22

+0

你是什么意思的“通过添加断线单独的按钮”?你需要两个按钮,它们之间有一点空间吗? – Sadiq 2015-04-04 18:10:02

回答

2
<LinearLayout 
    android:id="@+id/topHourlyLayout" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 


    > 

     <Button android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:id="@+id/button_so" 
android:text="@string/stack" 
android:onClick="goToSo" 
android:lines="1" 
android:margin_bottom="7dp"/> 



<Button android:layout_height="wrap_content" 
android:layout_width="wrap_content" 
android:text="@string/superuser" 
android:id="@+id/button_su" 
android:onClick="goToSu"/> 

    </LinearLayout> 
+0

仍然无法正常工作。他们彼此相邻。我希望他们在下。 – Oen44 2015-04-04 18:18:45

+0

无法编辑...所以它会创建一个黑色的垂直线,用于分隔按钮,但第二个按钮不在第一个按钮下方。 – Oen44 2015-04-04 18:27:59

+0

你可以发布图片样本你需要什么。对不起,但我不清楚你的要求。 – Sadiq 2015-04-04 18:29:31