#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *rotateLable = [[UILabel alloc] initWithFrame:CGRectMake(164, 300, 200, 44)];
rotateLable.text = @"QWJIFHASDFNAMSFJO";
[self transformLabel:rotateLable WithTransX:-145.0f andTransY:0.0f andAngle:(-M_PI / 2)];
[self.view addSubview:rotateLable];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)transformLabel:(UILabel *)label WithTransX:(CGFloat )tx andTransY:(CGFloat )ty andAngle:(CGFloat )angle{
label.transform = CGAffineTransformRotate(CGAffineTransformMakeTranslation(tx, ty), angle);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
让Label竖着显示
最新推荐文章于 2025-04-11 15:47:45 发布