Develop
2014.01.09 14:19
[ios] UIButton multi-line iOS7
조회 수 11454 댓글 0
예전에 멀티라인 버튼을 아래처럼 작성했던게..
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];
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
345 | System/OS | [linux] Proftpd 설치 가이드 | hooni | 2003.04.23 | 13064 |
344 | System/OS | [linux] ipfwadm를 이용한 패킷필터링(구버전) | hooni | 2003.04.23 | 13073 |
343 | System/OS | [linux] DHCP(Dynamic Host Configuration Protocol) 서버 | hooni | 2003.04.23 | 13075 |
342 | System/OS | [linux] 한글 URL 인식할 수 있게 아파치(Apache) 설정 (mod_url.c 설치) | hooni | 2013.04.23 | 13116 |
341 | PPT |
[js] xsl 강의 자료
![]() |
hooni | 2013.04.23 | 13198 |
340 | Develop |
[jsp] RSS(xml) 파싱해서 보여주기 ㅎㅎ
![]() |
hooni | 2013.04.23 | 13223 |
339 | System/OS | [linux] 계정관리하기(내공쌓기) | hooni | 2003.04.23 | 13225 |
338 | Develop |
[ios] App States
![]() |
hooni | 2013.07.22 | 13228 |
337 | System/OS | [linux] 아파치설치/설정 - SSI(Server Side Include) | hooni | 2003.04.23 | 13245 |
336 | Develop | [c#] 파일(File) 쓰기 ㅎㅎ | hooni | 2013.04.23 | 13311 |
335 | Develop | [ios] 간단한 방법으로 OS버전 확인하기. | hooni | 2013.09.24 | 13344 |
334 | System/OS | [linux] Xwindow/Xmanager 사용 | hooni | 2003.04.23 | 13373 |