How to raise uilabel in ios

I am creating an iphone application. In this application, I want to raise the label according to the attached screenshot. enter image description here (see table $ 120)

The red color image is in the background, and I want to raise its top.

I used the transform method to rotate. But he does not push him. the label is compressed

 testLabel.transform = CGAffineTransformMakeRotation(30 * M_PI / 180.0); 
+4
source share
5 answers

Your shortcut is being compressed due to an incorrect frame setting. You should put your shortcut in a UIView and rotate this view instead of the label. Also, check that your UIView does not support any annotations.

+2
source

Try something like this:

 label.transform = CGAffineTransformMakeRotation(M_PI / 4); // 45 degree rotation 
+5
source

Try it.

 #define DEGREES_TO_RADIANS(angle) (angle / 180.0 * M_PI) CGAffineTransform transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(0.-7)); lbl.transform = transform; lbl.text=name; 
+5
source

Use the transform property of UILabel

such as

 lblComingSoon.transform = CGAffineTransformMakeRotation(M_PI_2*2.5);// your can set angle as you need. 

Alos read this official documantaion.
AND

For more information, this question is related to your question => Goal C: How can you rotate text for UIButton and UILabel?

+1
source

use this code:

 label.transform = CGAffineTransformMakeRotation(2*M_PI / 3); 
0
source

Source: https://habr.com/ru/post/1490234/


All Articles