uibutton 使用settitle后如何修改其中文字对齐方式

时间:2014-08-08 11:55:15   收藏:0   阅读:246

 UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
            btn.frame = CGRectMake(5, self.alertView.lableView.frame.size.height + self.checkBox.frame.size.height + 80.0f, self.localView.frame.size.width - self.localView.frame.size.width/8*2-30, 30);
            self.leftBtn = btn;
            //[self.leftBtn setBackgroundImage: [UIImage imageNamed:@"popup_btn@2x.png"]forState:(UIControlStateNormal)];
            //[self.leftBtn setBackgroundImage: [UIImage imageNamed:@"popup_btn_onfocus@2x.png"]forState:(UIControlStateHighlighted)];
            [self.leftBtn setTitle:NSLocalizedStringFromTable(@"alert_view_new_album_delete", @"StringInfo", nil) forState:UIControlStateNormal];
            [self.leftBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            [self.leftBtn addTarget:self action:@selector(startNewAlbum:) forControlEvents:UIControlEventTouchUpInside];
            self.leftBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
            [self.alertView setLeftBtn:self.leftBtn];
            [btn release];

uibutton 使用settitle后如何修改其中文字对齐方式,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!