Ios6 为什么在UIPopover中嵌入的UITextField中键入时看不到文本?
我有一个iPad应用程序XCode 4.6,ARC,情节串连板,当用户点击UI按钮时,我想在其中显示一个带有UIExtField的popover 弹出框显示,键盘显示,但UITextField中没有显示任何内容。我错过了什么 代码如下:Ios6 为什么在UIPopover中嵌入的UITextField中键入时看不到文本?,ios6,uitextfield,xcode4.6,uipopover,Ios6,Uitextfield,Xcode4.6,Uipopover,我有一个iPad应用程序XCode 4.6,ARC,情节串连板,当用户点击UI按钮时,我想在其中显示一个带有UIExtField的popover 弹出框显示,键盘显示,但UITextField中没有显示任何内容。我错过了什么 代码如下: // make the popover UIViewController* popoverContent = [[UIViewController alloc] init]; UIView* popoverView = [[UIView alloc]
// make the popover
UIViewController* popoverContent = [[UIViewController alloc] init];
UIView* popoverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 450, 500)];
popoverView.backgroundColor = [UIColor colorWithWhite:(CGFloat)1.0 alpha:(CGFloat)1.0]; // frame color?
popoverContent.view = popoverView;
//resize the popover view shown in the current view to the view's size
popoverContent.contentSizeForViewInPopover = CGSizeMake(450, 500);
// add the UITextfield to the popover
UITextField *tf = [[UITextField alloc]init];
[tf becomeFirstResponder];
[popoverView addSubview:tf];
//create a popover controller
popoverController = [[UIPopoverController alloc] initWithContentViewController:popoverContent];
[popoverController presentPopoverFromRect:((UIButton *)oSendFeedback).frame inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
文本字段应使用
UITextField *tf = [[UITextField alloc] initWithFrame:...]
指定字段的原点和大小。文本字段应使用
UITextField *tf = [[UITextField alloc] initWithFrame:...]
指定字段的原点和大小。男孩,那一个在托克斯咬了我一口!我只是讨厌我做那样的事。。。你能删除你的评论,然后作为回答重新做吗?谢谢你……:天哪,那家伙在托克斯咬了我一口!我只是讨厌我做那样的事。。。你能删除你的评论,然后作为回答重新做吗?谢谢你……:D