일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Game
- 아이튠즈
- 게임
- smartfoxserver
- 배열
- Android
- 영어
- ios
- flash builder
- path
- 태그를 입력해 주세요.
- Mac
- AIR
- 경로
- 3d
- XML
- file
- AS3
- Ane
- class
- unity3D
- iphone
- unity
- swf
- sdk
- builder
- 단축키
- texture
- Build
- Flash
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 사이즈의 라벨이 생성되고 중앙정렬에 투명한 배경으로 흰색글씨의 라벨이 화면에 보여진다.