#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豎着顯示
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.