P PaoV New Member Licensed User Longtime User Aug 5, 2013 #1 Is there a function to change the font typeface of the whole app or acitivity? Besides, changing the font in the labels, then go change the font in the buttons, and so on. Also, is it possible to change the font typeface of the Menu (activity.addMenuItem)?
Is there a function to change the font typeface of the whole app or acitivity? Besides, changing the font in the labels, then go change the font in the buttons, and so on. Also, is it possible to change the font typeface of the Menu (activity.addMenuItem)?
barx Well-Known Member Licensed User Longtime User Aug 5, 2013 #2 Not sure if it is possible but if I was to try it I would look at this page here... http://stackoverflow.com/questions/16404820/how-to-set-default-font-family-for-entire-android-app and the use my Theme based on Version tutorial here... http://www.b4x.com/android/forum/threads/theme-based-on-version-tutorial.27624/#post-160014 mashing them 2 together could well produce the required results. Either that or create a sub that iterates through the views on an activity and changes font accordingly then call the sub from each activity once all layout stuff is loaded. Upvote 0
Not sure if it is possible but if I was to try it I would look at this page here... http://stackoverflow.com/questions/16404820/how-to-set-default-font-family-for-entire-android-app and the use my Theme based on Version tutorial here... http://www.b4x.com/android/forum/threads/theme-based-on-version-tutorial.27624/#post-160014 mashing them 2 together could well produce the required results. Either that or create a sub that iterates through the views on an activity and changes font accordingly then call the sub from each activity once all layout stuff is loaded.
Erel B4X founder Staff member Licensed User Longtime User Aug 6, 2013 #3 The following code will set the typeface of most views (labels, EditTexts, Buttons, CheckBoxes and RadioButtons): Code: Copy Sub SetTypeface(parent As Panel, t As Typeface) For Each v As View In parent If v Is Panel Then SetTypeface(v, t) Else If v Is Label Then Dim lbl As Label = v lbl.Typeface = t End If Next End Sub Upvote 0
The following code will set the typeface of most views (labels, EditTexts, Buttons, CheckBoxes and RadioButtons): Code: Copy Sub SetTypeface(parent As Panel, t As Typeface) For Each v As View In parent If v Is Panel Then SetTypeface(v, t) Else If v Is Label Then Dim lbl As Label = v lbl.Typeface = t End If Next End Sub