2015-04-04 62 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