我正在将 UITextfield 添加到 UIAlertView,如下所示:
UIAlertView *addingBookAlert=[[UIAlertView alloc]initWithTitle:@"Enter Note" message:NULL delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
addingBookAlert.tag=kAddNoteAlertTag;
myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
myTextField.placeholder=@"Book Mark";
[myTextField becomeFirstResponder];
[myTextField setBackgroundColor:[UIColor whiteColor]];
myTextField.textAlignment=UITextAlignmentCenter;
myTextField.delegate=self;
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, 60);
[addingBookAlert setTransform:myTransform];
[addingBookAlert addSubview:myTextField];
[addingBookAlert show];
我用文本字段、取消和确定按钮对其进行纵向显示。但在横向中,它只出现文本字段、取消和确定按钮不出现。
如何解决这个问题...在此先感谢。