I'm trying to change font size of message in alert dialog through styles 
but I can't make it work. There is a lot of answers describing how to do 
this but almost all of them I found do it programmatically. I want to do 
this once in styles, not with every new alertdialog.


What I've done so far:

In \AndroidSDK\platforms\android-23\data\res\layout\alert_dialog.xml I see 
the TextView that is showing the message:


<TextView android:id="@+id/message"
    style="?android:attr/textAppearanceMedium"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="5dip" />


In \AndroidSDK\platforms\android-23\data\res\values\themes.xml I see that 
the value of textAppearanceMedium attribute is @style/TextAppearance.Medium.


I've created a following style of which the parent is 
TextAppearance.AppCompat.Medium. This style is then applied to 
android:textAppearanceMedium attribute of AlertDialog's style as follows:


<style name="Theme.My" parent="Theme.AppCompat.Light.NoActionBar.FullScreen">
    <item 
name="android:alertDialogTheme">@style/Theme.My.AlertDialog</item></style>
<style name="Theme.My.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
    <item 
name="android:textAppearanceMedium">@style/MyTextAppearanceMedium</item></style>
<style name="MyTextAppearanceMedium" parent="TextAppearance.AppCompat.Medium">
    <item name="android:textSize">24sp</item></style>


...but the font size won't change. What's wrong? I'm using AppCompat 
support lib, min SDK 16, target SDK 23.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/f5d3f8d7-82ca-466f-b768-2ea829d39387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to