You can include it inside a panel.
Rotating the panel will rotate even the view contained in it.
Probably it will be enough to declare it as a B4XView and then you should have the Rotation method.
The panel trick can be useful if you need to rotate a group of view all together.
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private Label1 As B4XView
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Label1.Rotation = 45
End Sub
I would suggest you to use the code in post #1.
But you could use this alternative:
B4X:
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private Label1 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
Label1.As(B4XView).Rotation = 45
End Sub
You should always prefer the @Sagenut version, i.e. declare the Label as B4XView and, if necessary, use the AS function to temporarily convert to the native View (Label in this case), not viceversa.
You should always prefer the @Sagenut version, i.e. declare the Label as B4XView and, if necessary, use the AS function to temporarily convert to the native View (Label in this case), not viceversa.
I spoke in general. It would be a good habit to declare all the views as B4XView, therefore also that TextEdit (and, when nedeed, use TextEdit specific properties "via" the AS function; this because B4XView cannot have all properties of all native views).