zoukankan      html  css  js  c++  java
  • uibutton 使用settitle后如何修改其中文字对齐方式

     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];

  • 相关阅读:
    一般图的最大匹配-带花树算法
    Codeforces703D-Mishka and Interesting sum-离线树状数组
    HDU4578-代码一点都不长的线段树
    AOJ.综合训练.2016-12-1
    AOJ.综合训练.2016-12-1
    队列的实现
    队列的实现
    栈的实现
    栈的实现
    贪心算法总结
  • 原文地址:https://www.cnblogs.com/lisa090818/p/3898682.html
Copyright © 2011-2022 走看看