Show "label" vertical

vecino

Well-Known Member
Licensed User
Longtime User
Hi, one question: is it possible to display a "label" vertically?
Thanks and regards.

Example:
 

Attachments

  • vertical.png
    1.5 KB · Views: 285

stevel05

Expert
Licensed User
Longtime User
Or you can use the reflection library on the view:

B4X:
Dim R As Reflector
   R.Target=Label1
   R.RunMethod2("setRotation","270","java.lang.float")

You won't be able to see the results in the designer.
 
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Hi, thanks for the answers, but I could not make it work.
In the first case comes directly the error: "java.lang.NullPointerException"
And in the second case: "java.lang.NoSuchMethodException: setRotation"
I may not have done well because I'm fairly novice, can you give me an example?
Many thanks and greetings
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
The example given should work if you have a label already visible in a layout.

So it needs to be added either with the designer or in code as normal.

The attached example shows the rotation with two labels.

If you can't get it working in your project, it would be useful if you can post your code.
 

Attachments

  • rt.zip
    6.9 KB · Views: 335
Upvote 0

vecino

Well-Known Member
Licensed User
Longtime User
Thank you very much, it works perfectly.
The problem is that it works in the "Emulator", but it does on the tablet.
Thanks and regards.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, it will only work on API 11, honeycomb or later.
 
Upvote 0

IanMc

Well-Known Member
Licensed User
Longtime User
yah, I'm getting the java.lang.NoSuchMethodException: setRotation

on your demo.

Is it because of my Android version 2.3.7 ?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes it needs Android 3
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
You could try using the animation library with a short duration, see the thread for discussion on how to get the animation to stay at the end.
 
Last edited:
Upvote 0

IanMc

Well-Known Member
Licensed User
Longtime User
Hey thanks steve and I'll also have a look at the Canvas as suggested by NJ.

Thanks!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…