2015-08-15 94 views
0

我想向我的自定義對話框添加陰影。但如何刪除這個白色邊框?請幫助我)將陰影添加到自定義對話框

add shadow to custom dialog

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:minWidth="300dp" 
android:background="@android:drawable/dialog_holo_light_frame" 
android:orientation="vertical" > 
    <TextView 
     android:id="@+id/header" 
     android:layout_width="match_parent" 
     android:layout_height="20dp" 
     android:background="@color/brown" 
     android:gravity="top|center" 
     android:text="" 
     android:textColor="@color/white" /> 
    ... 
    </LinearLayout> 
+1

在這裏你可以找到答案http://stackoverflow.com/questions/10433764/alertdialog-how -to-remove-black-borders-above-and-below-view – amaiaeskisabel

+0

謝謝!我找到了! –

回答

0

添加自定義樣式

<style name="Theme.CustomDialog" parent="@android:style/Theme.Translucent.NoTitleBar"> 
<item name="android:windowIsFloating">true</item> 
<item name="android:windowNoTitle">true</item> 
<item name="android:padding">10dp</item> 
<item name="android:background">#ff90ff90</item>