UIButton 标题靠右

    _classBtn =  [UIButton buttonWithType:UIButtonTypeCustom];

    _classBtn.frame = CGRectMake(  kDeviceWidth -200-30-10,  l2.top , 200, 30);

    _classBtn.backgroundColor = [UIColor yellowColor];

    _classBtn.titleLabel.font = [UIFont systemFontOfSize:12];

    [_classBtn setTitleColor:kMainBlueColor forState:0];

    [_classBtn setTitle:@"点击选择分类" forState:0];

    _classBtn.contentHorizontalAlignment  =  UIControlContentHorizontalAlignmentRight; //标题靠右

    [contentScrollView addSubview:_classBtn];

猜你喜欢

转载自www.cnblogs.com/iOS-mt/p/9232143.html
今日推荐