- (void)viewDidLoad { [super viewDidLoad]; DpLabel *label = [[DpLabel alloc] initWithFrame:CGRectMake(20, 120, self.view.frame.size.width-40, 50)]; label.text = @测试对齐方式; label.textAlignment = VerticalAlignmentTop; label.backgroundColor = [UIColor redColor]; [self.view addSubview:label]; } |
|