0

Hi I am working with calendar view. I want it's text to be 12sp but I am not be able to set it. I have tried for android:dateTextAppearance="@android:style/TextAppearance.Small" but it is not working.

Thanks in advance

nidh
  • 3
  • 1
  • 3

1 Answers1

2

You should have been able to set

android:dateTextAppearance="@android:style/TextAppearance.Small"

Although unless you override, you won't be able to set the size of small. Create an updated style in your styles which overrides parent "@android:style/TextAppearance.Small". (i.e. styles/style.xml)

<style name="SmallerCalendarText" parent="@android:style/TextAppearance.Small">
    <item name="android:textSize">8dp</item>
</style>

And now in your layout xml file for the CalendarView widget:

    <CalendarView
        ...
        android:dateTextAppearance="@style/SmallerCalendarText" />
VMcPherron
  • 584
  • 1
  • 6
  • 10
  • How did you know to override that style element? Im more interested in how one would arrive at this strategy. – Clinton Feb 25 '22 at 10:13