Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Xcode
- simulator
- 해몽
- Example
- afterdelay
- 신도림 테크노마트
- Check
- 얻는법
- error
- UIView
- swift3
- 샘플
- 페이백
- swift
- setting
- 공략
- 스마트폰
- 보라카이
- 신도림
- 앱스토어
- 포켓볼
- 포켓몬 GO
- IOS
- LG유플러스
- push
- UITableView
- Bitcode
- 아이폰7
- loop
- GCD
Archives
- Today
- Total
도래울
UILabel programmatically by Swift 본문
// CGRectMake has been deprecated - and should be let, not var
let label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 21))
// you will probably want to set the font (remember to use Dynamic Type!)
label.font = UIFont.preferredFont(forTextStyle: .footnote)
// and set the text color too - remember good contrast
label.textColor = .black
// may not be necessary (e.g., if the width & height match the superview)
// if you do need to center, CGPointMake has been deprecated, so use this
label.center = CGPoint(x: 160, y: 284)
// this changed in Swift 3 (much better, no?)
label.textAlignment = .center
label.text = "I am a test label"
self.view.addSubview(label)
'개발 > iOS' 카테고리의 다른 글
swift image cash (0) | 2018.02.27 |
---|---|
애플 앱스토어 한국, 미국 시차 (0) | 2017.12.20 |
iOS 11 - Keyboard Height is returning 0 in keyboard notification (0) | 2017.10.10 |
앱스토어 앱 긴급 심사 방법 (0) | 2017.09.29 |
this action could not be completed. try again. (-22421) 오류 해결 (0) | 2017.09.27 |
Comments