ユーザーログイン用のUIAlertView内にユーザーIDとパスワード用の2つのUITextFieldまたはTextBoxを作成する必要があるアプリケーションを作成しています。何かを試しましたが、作成されたテキストフィールドが非常に大きくなり、アラートビュー全体をほぼカバーしています。アラート ビュー内でテキスト フィールドやラベルなどを整理する方法。「ユーザーID」と「パスワード」というラベルに対して小さなテキストフィールドが必要です。では、どうやってそれを行うのですか?私を助けてください。事前にサンクス。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"User Login" message:@"Please Enter the Following \n\n\n\n\n\n\n" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:@"Sign In", nil];
UILabel *lblUserName = [[UILabel alloc] initWithFrame:CGRectMake(20, 70, 85, 21)];
lblUserName.tag =2;
//lblUserName.backgroundColor = [UIColor darkGrayColor];
lblUserName.font = [UIFont systemFontOfSize:15.0];
lblUserName.text = @"User Name:";
lblUserName.textColor=[UIColor whiteColor];
//[lblUserName setFont:[UIFont fontWithName:@"TimesNewRomanPS-boldMT" size:8]];
lblUserName.backgroundColor = [UIColor clearColor];
[alert addSubview:lblUserName];
UITextField *txtUserName;
//if(txtUserName==nil)
txtUserName = [[UITextField alloc] initWithFrame:CGRectMake(89, 50, 160, 30)];
txtUserName.tag = 3;
txtUserName.borderStyle = UITextBorderStyleBezel;
txtUserName.textColor = [UIColor whiteColor];
txtUserName.font = [UIFont systemFontOfSize:12.0];
txtUserName.placeholder = @"User ID";
[alert addSubview:txtUserName];
alert.tag=3;
[alert show];
[alert release];