Steven Schoen
Steven Schoen

Reputation: 4386

Setting a theme for my custom DialogPreference?

I have a custom DialogPreference that I use for a SeekBar. I override style="@style/Theme.Putio.Dialog" and inflate the layout from XML.

The problem is, the resulting dialog uses the default Android dialog style, and I want it to use mine.

Where do I tell it to use my dialog? I'll post code if necessary.

Upvotes: 2

Views: 1309

Answers (1)

JiTHiN
JiTHiN

Reputation: 6588

You can define custom styles for your Dialog inside the styles.xml

<style name="CustomDialogTheme" parent="@android:style/Theme.Dialog">
<item name="android:windowBackground">@drawable/dialogback</item>
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowNoTitle">true</item></style>

And to use following code while creating the Dialog.

final Dialog CustomDialog = new Dialog(MyActivity.this,R.style.CustomDialogTheme);

Upvotes: 2

Related Questions