I want user to use SeekBar to choose the font size and apply it to whole app. I don't want to extend base classes eg TextView. I'm thinking something like in styles.xml set font size.
<item name="android:textSize">X</item>
Where "X" is a font size load from SharedPreferences. Is this even possibile? Also I want that text will change dynamical in app. So if user select with SeekBar font size to eg 20dp. It will change instantly. I found this . But there is exemple with predefined font size and this is not I'm looking for.
No, you can't dynamically change values from resource files. This is how I would do it:
SharedPreferences
. SharedPreferences
and apply it to all TextViews
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.