iphone应用程序中的actionSheet

时间:2010-12-24 10:32:41

标签: iphone iphone-sdk-3.0

我是iphone的新用户。可以在动作表或警报视图中保留3个文本字段,3个标签和2个uibutton。请提供信息。

提前致谢。

1 个答案:

答案 0 :(得分:0)

你可以试试这个:

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"\n\n\n\n\n\n\n\n\n\n" message:@"" delegate:self cancelButtonTitle:@"Cancel"  otherButtonTitles:@"OK", nil];

UITextField *textfield1 = [[UITextField alloc] init];
textfield1.frame = CGRectMake(10.0, 30.0,260.0, 15.0);//set your frame as you required
textfield1.text=@"";
[textfield1 setBackgroundColor:[UIColor whiteColor]];
[alert addSubview:textfield1];
[textfield2 release];

UITextField *textfield2 = [[UITextField alloc] init];
textfield2.frame = CGRectMake(10.0, 48.0,260.0, 15.0);//set your frame as you required
textfield2.text=@"";
[textfield2 setBackgroundColor:[UIColor whiteColor]];
[alert addSubview:textfield2];
[textfield2 release];

UITextField *textfield3 = [[UITextField alloc] init];
textfield3.frame = CGRectMake(10.0, 65.0,260.0, 155.0);//set your frame as you required
textfield3.text=@"";
[textfield3 setBackgroundColor:[UIColor whiteColor]];
[alert addSubview:textfield3];
[textfield3 release];

UIView *tempView = [[UIView alloc]initWithFrame:CGRectMake(10.0, 80.0, 260.0, 100.0)];//set your frame as you required
tempView.backgroundColor = [UIColor clearColor];
[alert addSubview:tempView];

UILabel *label1 = [[UILabel alloc]init];
label1.frame = CGRectMake(0, 5, 50, 15);//set your label frame here
label1.text = @"Enter text";
[tempView addSubView:label1];
[label1 release];

UILabel *label2 = [[UILabel alloc]init];
label2.frame = CGRectMake(0, 25, 50, 15);//set your label frame here
label2.text = @"Enter text";
[tempView addSubView:label2];
[label2 release];

UILabel *label3 = [[UILabel alloc]init];
label3.frame = CGRectMake(0, 45, 50, 15);//set your label frame here
label3.text = @"Enter text";
[tempView addSubView:label3];
[label3 release];

UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom];
button1.frame = //set your button frame here
[tempView addSubview:button1];

UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom];
button1.frame = //set your button frame here
[tempView addSubview:button2];

[tempView release];
[alert show];
[alert release];