Develop
2014.01.09 14:19
[ios] UIButton multi-line iOS7
Views 11469 Comment 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];
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
229 | Develop | [js] get방식, url이후 모두 그대로 읽어오기.. | hooni | 2013.04.23 | 6874 |
228 | Develop | [js] IE에서 인쇄 설정 팁 | hooni | 2013.04.23 | 10925 |
227 | Develop |
[js] Javascript로 만든 포트리스 (2010)
5 ![]() |
hooni | 2017.03.03 | 2831 |
226 | Develop | [js] jQjuery $ 활용 | hooni | 2013.12.17 | 8909 |
225 | Develop | [js] jQuery 배열 루프(each) | hooni | 2013.12.17 | 10025 |
224 | Develop | [js] jQuery plugin 요약 | hooni | 2013.12.20 | 10755 |
223 | Develop |
[js] jQuery 관련 문서 ㅎㅎ
![]() |
hooni | 2013.04.23 | 31260 |
222 | Develop | [js] jQuery 관련 사이트 링크 모음 | hooni | 2013.04.23 | 18282 |
221 | Develop |
[js] jQuery 셀 병합
1 ![]() |
hooni | 2014.09.23 | 3569 |
220 | Develop | [js] jQuery 셀랙터(selector) 요약 | hooni | 2013.12.17 | 9445 |
219 | Develop | [js] jQuery 충돌 회피 | hooni | 2013.12.17 | 38380 |
218 | Develop | [js] jQuery 치트 시트 | hooni | 2013.12.18 | 36307 |