UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Username and password" message:@"\n\n\n" // 중요!! 칸을 내려주는 역할을 합니다. delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Enter", nil]; textFieldName = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 50.0, 260.0, 25.0)]; [textFieldName setBackgroundColor:[UIColor whiteColor]]; [textFieldName setPlaceholder:@"username"]; [prompt addSubview:textFieldName]; textFieldPassword = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 85.0, 260.0, 25.0)]; [textFieldPassword setBackgroundColor:[UIColor whiteColor]]; [textFieldPassword setPlaceholder:@"password"]; [textFieldPassword setSecureTextEntry:YES]; [prompt addSubview:textFieldPassword]; // AlertView의 위치를 이동 시켜 줌. // [prompt setTransform:CGAffineTransformMakeTranslation(0.0, 110.0)]; [prompt show]; [prompt release]; // textfield에 커서를 보내고 키보드를 표시 해 줌. [textFieldName becomeFirstResponder];
In the .h file In the .m file
'프로그래밍 > iOS' 카테고리의 다른 글
Xcode Code Snippet Library를 통해 코드 문서화 쉽게 하기! (0) | 2012.06.21 |
---|---|
xcode static library 만들기(스테틱라이브러리만들기) (0) | 2012.06.21 |
아이폰 앱 76개 소스코드, 강좌, 개발 팁 링크모음 (0) | 2012.06.06 |
FaceBook Graph Api 설명 (0) | 2012.06.02 |
Swipe Gesture with UIWebView (0) | 2012.05.31 |