我要在Android中創建一個具有圓形形狀的提醒對話框。 我遵循這個網站的許多線程。創建shape.xml,並把它繪製資源Android:將圓形形狀應用於線性佈局
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="5dp" android:color="#FF0000" />
<corners android:bottomRightRadius="20dp" android:bottomLeftRadius="20dp"
android:topLeftRadius="20dp" android:topRightRadius="20dp"/> <solid android:color="#FFFF00"/>
和上面的形狀適用於LinearLayout中。 layout.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@android:color/transparent" >
<LinearLayout android:layout_width="200dip"
android:layout_height="60dip"
android:orientation="vertical"
android:background="@drawable/shape">
</LinearLayout>
不過,目前仍然有對話框外的矩形邊框和背面的顏色。這不是我想要的。 我有很長一段時間的搜索,我不知道如何解決它。 我的目標是讓它在對話框佈局的角落之外透明。非常感謝!
屏幕截圖:http://postimg.org/image/3xbnmquyt/
你能張貼那張圖嗎? –
就像[http://openclipart.org/people/rg1024/rg1024_set_of_eight_rounded_shapes.svg](this)中間一個的左邊。謝謝。 – dsafajw