Issue
I want to automatically scale font size depending on contents in Xamarin.Android app in custom class. Scaling works for TextView. But when I use NoobTextView scaling does not work.
Solution
In the original TextView, the autosize attributes refer to the android: namespace. And in it, auto-size only works on the latest versions of the droid. Attributes from app: are only picked up by appcompat versions. Judging by the fact that now it works in this form - I have an AppCompat or Material theme installed, in which, during inflate, an AppCompatTextView or MaterialTextView is created instead of a TextView. Accordingly, no substitution occurs for custom TextViews. The solution is to inherit from AppCompatTextView.
Answered By - S. Koshelnyk



0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.