【发布时间】:2010-03-11 02:22:31
【问题描述】:
当用户点击一个按钮时,我需要显示一个 UIView/UIViewController,并且模态视图的显示应该与在 UITextField 中编辑文本时键盘从底部栏中显示的方式一样。使用以下代码,我可以将其显示为弹出窗口。
[self presentModalViewController:child animated:YES];
如何让它看起来像键盘?
我了解模态视图覆盖了整个屏幕。但我真的想要一个只覆盖一半屏幕的视图。所以,请告诉我为什么这不起作用
MyController *controller = [[MyController alloc] initWithNibName:@"MyView" bundle:nil];
CGRect frame = CGRectMake(0,44,768,264);
[controller view].frame = frame;
contoller.delegate = self;
[[self view] addSubView:[controller view]];
[controller release];
我正在尝试向当前视图添加一个子视图,并使其出现在键盘出现的位置。
【问题讨论】:
标签: objective-c xcode uiviewcontroller model-view-controller