Develop
2014.01.09 14:19

[ios] UIButton multi-line iOS7

조회 수 11459 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
예전에 멀티라인 버튼을 아래처럼 작성했던게..
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.textAlignment = UITextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];

iOS6 에서 UILineBreakModeWordWrap, UITextAlignmentCenter 이게 deprecated 됨..
그래서.. 이렇게~
button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
button.titleLabel.textAlignment = NSTextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];

Background, Text, Multi-Line 샘플..
_button = [UIButton buttonWithType:UIButtonTypeCustom];
_button.frame = CGRectMake(buttonWidth*1, 65, buttonWidth, 43);
_button.titleLabel.font = [UIFont systemFontOfSize:12];
_button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
_button.titleLabel.textAlignment = NSTextAlignmentCenter;

[_button setTitle:@"라인1\n라인2" forState:UIControlStateNormal];

[_button setTitleColor:[UIColor
    colorWithRed:153/255.0
    green:153/255.0
    blue:153/255.0 alpha:1.0] forState:UIControlStateNormal];

[_button setTitleColor:[UIColor
    colorWithRed:81/255.0
    green:19/255.0
    blue:137/255.0 alpha:1.0] forState:UIControlStateSelected];

[_button setBackgroundImage:
    [UIImage imageNamed:@"06_setting_category_tab_n"]
    forState:UIControlStateNormal];

[_button setBackgroundImage:
    [UIImage imageNamed:@"06_setting_category_tab_s"]
    forState:UIControlStateSelected];

[_button addTarget:self
    action:@selector(_buttonAction:)
    forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:_button];

?

  1. [linux] root 전환시 패스워드 없이 su 사용하기

    Date2013.12.22 CategorySystem/OS Byhooni Views12772
    Read More
  2. [php] GregorianToJD(), JDToGregorian() 함수 내용

    Date2013.12.25 CategoryDevelop Byhooni Views10633
    Read More
  3. [php] 하루 전 날짜 쉽게 구하기.

    Date2013.12.25 CategoryDevelop Byhooni Views12275
    Read More
  4. [용어] POC, Pilot, BMT에 대한 IT 업계에서 통용되는 의미

    Date2014.01.02 CategoryEtc Byhooni Views42041
    Read More
  5. [js] AngularJS를 소개합니다.

    Date2014.01.06 CategoryDevelop Byhooni Views13046
    Read More
  6. iOS 에서 쓸만한 오프라인 구글지도 찾기

    Date2014.01.06 CategoryEtc Byhooni Views16089
    Read More
  7. [ios] UIButton multi-line iOS7

    Date2014.01.09 CategoryDevelop Byhooni Views11459
    Read More
  8. [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기

    Date2014.01.09 CategorySystem/OS Byhooni Views12285
    Read More
  9. [php] substr() 한글 자를 때 깨짐 방지

    Date2014.01.09 CategoryDevelop Byhooni Views20438
    Read More
  10. [ios] UIWebView 쿠키 유지

    Date2014.01.16 CategoryDevelop Byhooni Views11748
    Read More
  11. [ios] UIWebView에서 NSURLRequest에 Cookie 실어 보내기

    Date2014.01.16 CategoryDevelop Byhooni Views14900
    Read More
  12. [linux] CentOS 6.x Cati 설치 (yum)

    Date2014.01.17 CategorySystem/OS Byhooni Views48659
    Read More
  13. [js] 주소표시줄 URL 읽어오기 (변경까지)

    Date2014.01.21 CategoryDevelop Byhooni Views1
    Read More
  14. [ios] 네트워크 인디케이터(NetworkActivityIndicator) 작동

    Date2014.01.24 CategoryDevelop Byhooni Views12516
    Read More
  15. [ios] iOS 6.0 이상 회전 하기 (이전 버전과 비교 변경 부분)

    Date2014.01.27 CategoryDevelop Byhooni Views34236
    Read More
  16. [ios] NSString 간단한 정규식 사용법

    Date2014.01.28 CategoryDevelop Byhooni Views18264
    Read More
Board Pagination Prev 1 ... 51 52 53 54 55 ... 74 Next
/ 74