Hi All,
Below is a routine from a Sub to adjust the textsize for the device. I think the Sub was originally a snippet from Klaus.
The textsize Sub has been working well for a long time, I have tried to implement it in B4X pages with B4XViews and failed.
The following code is what I have tried without success with several variations. The App appears to be running somewhere but not in view. and nothing appears in the log.
The EditText part works if I noble the B4X part.
Any help much appreciated.
Regards Roger
Below is a routine from a Sub to adjust the textsize for the device. I think the Sub was originally a snippet from Klaus.
The textsize Sub has been working well for a long time, I have tried to implement it in B4X pages with B4XViews and failed.
B4X:
'TextSizeScale is calculated by the first part of the sub'
For Each v As View In Activity.GetAllViewsRecursive 'Adjust all textviews by TextSizeScale
If v Is Label Then
Private lbl As Label = v
lbl.TextSize = lbl.TextSize * TextSizeScale
End If
Next
The following code is what I have tried without success with several variations. The App appears to be running somewhere but not in view. and nothing appears in the log.
The EditText part works if I noble the B4X part.
B4X:
'Adjust text size for views by TextSizeScale which has been already calculated
'Some views are on child panels of ActivityPnl
For Each v As View In ActivityPnl.GetAllViewsRecursive
If v Is EditText Then
'Log("ET")
Private ET1 As EditText = v
ET1.TextSize = ET1.TextSize * TextSizeScale
Else
'Log(v.Tag)
Private B4XV As B4XView = v '.Tag 'Could be Button, Label, Panel
B4XV.TextSize = B4XV.TextSize * TextSizeScale
End If
Next
Any help much appreciated.
Regards Roger