Develop
2014.01.09 14:19
[ios] UIButton multi-line iOS7
조회 수 11468 댓글 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];
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
625 | Develop | [js] jQuery 코드 작성시 편리한 HTML 템플릿 | hooni | 2013.12.17 | 33120 |
624 | Develop | [js] jQuery 치트 시트 | hooni | 2013.12.18 | 36306 |
623 | Develop | [js] jQuery 충돌 회피 | hooni | 2013.12.17 | 38379 |
622 | Develop | [js] jQuery 셀랙터(selector) 요약 | hooni | 2013.12.17 | 9445 |
621 | Develop |
[js] jQuery 셀 병합
1 ![]() |
hooni | 2014.09.23 | 3569 |
620 | Develop | [js] jQuery 관련 사이트 링크 모음 | hooni | 2013.04.23 | 18282 |
619 | Develop |
[js] jQuery 관련 문서 ㅎㅎ
![]() |
hooni | 2013.04.23 | 31260 |
618 | Develop | [js] jQuery plugin 요약 | hooni | 2013.12.20 | 10755 |
617 | Develop | [js] jQuery 배열 루프(each) | hooni | 2013.12.17 | 10025 |
616 | Develop | [js] jQjuery $ 활용 | hooni | 2013.12.17 | 8909 |
615 | Develop |
[js] Javascript로 만든 포트리스 (2010)
5 ![]() |
hooni | 2017.03.03 | 2830 |
614 | Develop | [js] IE에서 인쇄 설정 팁 | hooni | 2013.04.23 | 10925 |