일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 단축키
- path
- 게임
- texture
- builder
- 3d
- swf
- Flash
- class
- AIR
- file
- 배열
- XML
- Build
- flash builder
- 아이튠즈
- 경로
- Ane
- 영어
- iphone
- sdk
- ios
- unity
- 태그를 입력해 주세요.
- Android
- Mac
- Game
- smartfoxserver
- unity3D
- AS3
Archives
- Today
- Total
상상 너머 그 무언가...
UILabel 추가하기 본문
특정 뷰에 라벨을 생성해서 붙이는 방법
UILabel *testLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 30)];
testLabel.center = viewCtrl.view.center;
testLabel.text = @"라벨테스트";
testLabel.textAlignment = NSTextAlignmentCenter; // 글씨 중앙정렬
testLabel.backgroundColor = [UIColor clearColor]; // 배경색 투명으로
testLabel.textColor = [UIColor whiteColor]; // 글씨색 흰색으로
[viewCtrl.view addSubview:testLabel];
[testLabel release];
이렇게 하면 200*30 사이즈의 라벨이 생성되고 중앙정렬에 투명한 배경으로 흰색글씨의 라벨이 화면에 보여진다.