J Jerryk Active Member Licensed User Longtime User Nov 9, 2024 #1 I need a Label that is displayed vertically (it is rotated 90 degrees). I can do this programmatically by putting a Label in the Panel and rotating SetRotationAnimated( 0, 90 ). But is there any component that would already be displayed vertically in the Designer?
I need a Label that is displayed vertically (it is rotated 90 degrees). I can do this programmatically by putting a Label in the Panel and rotating SetRotationAnimated( 0, 90 ). But is there any component that would already be displayed vertically in the Designer?
William Lancee Well-Known Member Licensed User Longtime User Nov 9, 2024 #2 You can use the Designer Script Extension. You won't see the results in designer, but when you run the code it will be there. Put this in B4XMainPage B4X: Copy Private Sub RotateView(DesignerArgs As DesignerArgs) If DesignerArgs.FirstRun Then Dim v As B4XView = DesignerArgs.GetViewFromArgs(1) Dim angle As Float = DesignerArgs.Arguments.Get(0) v.Rotation = angle End If End Sub In the Designer: Script section, add B4X: Copy 'All variants script B4XMainPage.RotateView(-90, Label1) Upvote 1
You can use the Designer Script Extension. You won't see the results in designer, but when you run the code it will be there. Put this in B4XMainPage B4X: Copy Private Sub RotateView(DesignerArgs As DesignerArgs) If DesignerArgs.FirstRun Then Dim v As B4XView = DesignerArgs.GetViewFromArgs(1) Dim angle As Float = DesignerArgs.Arguments.Get(0) v.Rotation = angle End If End Sub In the Designer: Script section, add B4X: Copy 'All variants script B4XMainPage.RotateView(-90, Label1)