该对话框看起来是这样的。有对话框本身约10-20个像素左右每一侧后面的层。我使用的主题是Theme.Holo.Dialog
The dialog looks like this. There is a layer behind the dialog itself about 10-20 pixels or so on each side. The theme I am using is Theme.Holo.Dialog
我试图创建一个透明背景的自定义对话框,但没有奏效:
I tried creating a custom dialog with a transparent background, but that did not work:
<style name="CustomHoloDialog" parent="@android:style/Theme.Holo.Dialog">
<item name="android:background">@android:color/transparent</item>
</style>
没有人有任何想法吗?
Does anyone have any ideas on this?
如果你想样式对话框,那么你必须使用一个 ContextThemeWrapper
:
If you want to style a Dialog then you have to use a ContextThemeWrapper
:
AlertDialog.Builder mBuilder = new AlertDialog.Builder(new ContextThemeWrapper(context, android.R.style.Theme_Holo_Dialog));
上一篇:安卓发送大量短信的短信
下一篇:重写View.onSaveInstanceState()和View.onRestoreInstanceState()使用View.BaseSavedState?重写、View、onSaveInstan