Reputation: 11146
While testing for an application I found an unknown behavior. I have defined some certain font size for TextView I am using. Now if I go in Device Setting -> and Change Display-?>Font size then it reflect in application as well. Font get tiny/large as what set in settings.
Any suggestion how can prevent from this.
Upvotes: 1
Views: 61
Reputation: 821
You might be using sp while defining font size in xml. To prevent this behavior you can use dp instead of sp.
An sp is the same base unit, but is scaled by the user's preferred text size (it’s a scale-independent pixel), so you should use this measurement unit when defining text size (but never for layout sizes).
Hope this helps :)
Upvotes: 1