0

I have a custom style file(style.xml) in res/values that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
        <item name="android:windowBackground">@null</item>
        <item name="android:windowNoTitle">true</item>
    </style>
</resources>

I made it specially for removing the default white frame of my dialog. But when I create the dialog object, Eclipse can,t find the style(CustomDialogTheme), as I supposed to pass it as the parameter of the Dialog Constructor(Dialog(getParent(),android.R.style.CustomDialogTheme)). I went one by one for the second parameter like Android.(then the menu comes up =>R.style.(now there is no style named CustomDialogTheme)).

What alternate should I use now and please don't suggest me to use AlertDialog as I already change it from AlertDialog to Dialog.

4

1 回答 1

1

你试试这个

R.style.CustomDialogTheme only

Dialog(getParent(),R.style.CustomDialogTheme)

因为android.R.style我认为它将预定义样式定义为 android.R.style 以及我们直接与属于当前应用程序的 R.style 一起使用的任何自定义创建的布局、样式或主题

于 2011-11-23T06:13:36.587 回答