Set Android Theme.Light for Alert Dialog

不问归期 提交于 2019-12-03 09:30:40
Gallal

change parent="android:Theme.Light" to parent="@android:style/Theme.Light"

This took me a while to figure out as well.

The issue at hand is that Theme.Light and Theme.Holo.Light and such are designed around the activity. A dialog theme needs to be based around a theme such as @android:style/Theme.Dialog which contains properties specific to dialogs.

<style name="popup_theme" parent="@android:style/Theme.Dialog">

Try overriding the Theme.Dialog using things like:

<item name="android:textAppearance">?android:attr/textAppearanceInverse</item>
Chandu
parent="android:style/Theme.Light"

Try this:

<style name="popup_theme" parent="Theme.AppCompat.Light.Dialog.Alert">

This is what I did. And it worked for me

AlertDialog.Builder builder = new AlertDialog.Builder(context,R.style.Theme_AppCompat_Light_Dialog);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!