标签栏控制器不可访问
我为 iPhone 创建了一个基于选项卡的应用程序。当按下第一个选项卡时,将显示第一个视图。该视图包含一个按钮,按下该按钮时会加载另一个视图。
代码是:
-(IBAction)buttonPressed: (id) sender
{
Cities *cv=[[Cities alloc] initWithNibName:@"Cities" bundle:nil];
cv.modalTransitionStyle=UIModalTransitionStyleCoverVertical;
[self presentModalViewController:cv animated:YES];
[cv release];
}
现在的问题是该视图正在整个屏幕中加载,因此我无法访问选项卡栏。 我已经为此视图设置了框架,并且视图正在该框架中加载, -(void)viewWillAppear:(BOOL)动画 { self.view.frame = CGRectMake(0, 0, self.view.frame.size.width, 400); } 但在其余部分出现白屏意味着标签栏无法访问。
我希望任何时候加载的内容都应该始终可以访问选项卡栏。
请帮帮我。
I have created a tab based application for iphone. when the 1st tab presses a first view will present. this view contains a button, on pressing it another view loads.
Code is:
-(IBAction)buttonPressed: (id) sender
{
Cities *cv=[[Cities alloc] initWithNibName:@"Cities" bundle:nil];
cv.modalTransitionStyle=UIModalTransitionStyleCoverVertical;
[self presentModalViewController:cv animated:YES];
[cv release];
}
Now problem is that this view is loading in whole screen so that I am not able to access tab bar.
I have set the frame for this view and the view is loading in this frame,
-(void)viewWillAppear:(BOOL)animated
{
self.view.frame = CGRectMake(0, 0, self.view.frame.size.width, 400);
}
but in remaining part white screen is appearing means tab bar is not accessible.
I want that whatever will be load at any time tab bar should be always accessible.
Please help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加
Add
您是否尝试过在标签栏中使用
UINavigationController
来挖掘您的UIViewControllers
?参考:将 NavigationController 添加到 Tabbar
您真的需要一个 viewController 类来显示您要显示的内容吗?
如果 der 没有使用核心功能,我认为使用 UIView 会容易得多。
快乐编码:)
Have you tried using
UINavigationController
inside your tabbar to dig inside yourUIViewControllers
??for Ref : Adding NavigationController to Tabbar
do you really need a viewController Class for what you are trying to display??
if der's no core functionality being used, i think it will be much easier with
UIView
.Happy Coding :)