Develop
2014.01.09 14:19
[ios] UIButton multi-line iOS7
조회 수 11437 댓글 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] ipfwadm를 이용한 패킷필터링(구버전) | hooni | 2003.04.23 | 13025 |
344 | Develop | [html] 캐쉬된 웹페이지 사용하지 않도록 하는 방법 | hooni | 2003.04.23 | 13028 |
343 | System/OS | [linux] Proftpd 설치 가이드 | hooni | 2003.04.23 | 13030 |
342 | System/OS | [linux] 한글 URL 인식할 수 있게 아파치(Apache) 설정 (mod_url.c 설치) | hooni | 2013.04.23 | 13067 |
341 | System/OS | [linux] 계정관리하기(내공쌓기) | hooni | 2003.04.23 | 13162 |
340 | PPT | [js] xsl 강의 자료 | hooni | 2013.04.23 | 13186 |
339 | Develop | [ios] App States | hooni | 2013.07.22 | 13195 |
338 | System/OS | [linux] 아파치설치/설정 - SSI(Server Side Include) | hooni | 2003.04.23 | 13207 |
337 | Develop | [jsp] RSS(xml) 파싱해서 보여주기 ㅎㅎ | hooni | 2013.04.23 | 13217 |
336 | Develop | [c#] 파일(File) 쓰기 ㅎㅎ | hooni | 2013.04.23 | 13300 |
335 | Develop | [ios] 간단한 방법으로 OS버전 확인하기. | hooni | 2013.09.24 | 13318 |
334 | System/OS | [linux] Xwindow/Xmanager 사용 | hooni | 2003.04.23 | 13343 |