MitchBu Well-Known Member Licensed User Longtime User Feb 22, 2022 #1 Is it possible to rotate a textview ?
Sagenut Expert Licensed User Longtime User Feb 22, 2022 #2 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 Last edited: Feb 22, 2022 Upvote 0
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
klaus Expert Licensed User Longtime User Feb 22, 2022 #3 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 Upvote 0
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
MitchBu Well-Known Member Licensed User Longtime User Feb 22, 2022 #4 Thank you, Sagenut and Klaus. I shall experiment. Upvote 0
LucaMs Expert Licensed User Longtime User Feb 22, 2022 #6 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. Upvote 0
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.
MitchBu Well-Known Member Licensed User Longtime User Feb 23, 2022 #7 LucaMs said: 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. Click to expand... Actually, right now, I have tested a B4XPanel and laid a TextEdit onto it. Rotating works perfectly. Thank you. Upvote 0
LucaMs said: 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. Click to expand... Actually, right now, I have tested a B4XPanel and laid a TextEdit onto it. Rotating works perfectly. Thank you.
LucaMs Expert Licensed User Longtime User Feb 23, 2022 #8 MitchBu said: Actually, right now, I have tested a B4XPanel and laid a TextEdit onto it. Rotating works perfectly. Thank you. Click to expand... 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). Upvote 0
MitchBu said: Actually, right now, I have tested a B4XPanel and laid a TextEdit onto it. Rotating works perfectly. Thank you. Click to expand... 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).