我有一個對話框,底部有兩個按鈕。如何在這些按鈕上方創建分隔線?我的XML如下:如何在對話框中創建分隔線
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="400dp"
>
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/username"
android:layout_alignParentLeft="true" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:orientation="horizontal">
<Button
android:id="@+id/start"
android:textSize="18sp"
android:layout_marginRight="2dip"
android:layout_width="wrap_content"
android:layout_marginBottom="5dip"
android:padding="5dip"
android:layout_height="fill_parent"
android:text="Start" />
<Button
android:id="@+id/cancel"
android:textSize="18sp"
android:layout_marginLeft="2dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Cancel"
android:textColor="#000000" />
</LinearLayout>
</RelativeLayout>
對不起,我沒聽懂你什麼用的ImageView的放置...我需要一個線上方的按鈕 – teekib
是的。要在按鈕上方繪製一條線,您需要某種查看權限?你不能簡單地在佈局中放置一條線。 YOu或者需要有一個看起來像一條線的圖像或使ImageView看起來像一條線。這就是我在這裏所做的。如果你可以試一試,看看它看起來如何,你會明白正在嘗試做什麼。 –
哦好吧我現在試試吧 – teekib