UIAlertviewに3つのボタンと1つのテキストフィールドを配置する必要があります。私はこのようなコードを書いた。UIAlertviewにテキストフィールドとボタンを表示するときの問題
UIAlertView *share = [[UIAlertView alloc] initWithTitle:@"Refresh" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", @"Contacts", nil];
share.tag = 2;
[share setDelegate:self];
[share setTitle:@"Enter Name"];
[share setMessage:@" "];
nameField = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)];
[nameField setBackgroundColor:[UIColor whiteColor]];
[nameField setKeyboardType:UIKeyboardTypePhonePad];
[share addSubview:nameField];
[share show];
[share release];
[nameField release];
ただし、like thisと表示されます。
私は2つのボタンを置くとうまく表示されます。
新しいボタンを追加すると、それはリンクの上のショーとして次の行に追加されます。
しかし、3つのボタンをすべて1つの列に表示する必要があります。
どうすればいいですか?
私はメッセージnilを置いてみましたが、変更はありません。私は垂直にではなく、単一の列に水平にボタンが必要です...あなたはu rの答えを編集することができますpls。 – MaheshBabu
私は私の答えを更新しました;)それを見てください – nacho4d
私の要件に類似した他の方法はありますか? – MaheshBabu