iOS 4.1个人热点按下标签栏 [英] iOS 4.1 Personal hotspot pushing down tabbar

查看:87
本文介绍了iOS 4.1个人热点按下标签栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为iOS 4.1+编写应用程序,必须添加选项卡栏以编程方式查看控制器.

这是ViewController主代码:

- (void)viewDidLoad
{
     FirstViewVC* vc1 = [[FirstViewVC alloc] init];
     vc1.tabBarItem.title = @"Tab 1";
     AboutVC* vc2 = [[AboutVC alloc] init];
     vc2.tabBarItem.title = @"About Program";
     NSArray* controllers = [NSArray arrayWithObjects:vc1,vc2, nil];
     tabBarController.viewControllers = controllers;
     self.tabBarController.view.frame = [[self view] frame];
     tabBarController.view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight;

     self.view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:tabBarController.view];
         (...) //deallocs
}

结果如下:

http://img152.imageshack.us/img152/5176/nohotspotup.png

现在,如果我打开个人热点,一切都会下滑:

http://img528.imageshack.us/img528/9348/img0028y.png

如您所见,标签栏被切断.我尝试了多种方法来应用调整大小的蒙版和添加标签栏,但仍然无法正常工作.

有没有办法解决这个问题?

解决方案

这不是错误,如果您接听电话然后在通话仍处于活动状态时切换到您的应用,也会发生此错误.

这是您需要的东西.在布置UI时要考虑到这一点,并确保在该小节恢复到正常大小时UI会恢复到所需状态,这是另一件事需要注意.

此外,如果打开 iChat ,您可以在模拟器上进行测试,可能会更容易-我想现在您应该在Mountain Lion上使用 FaceTime应用,这应该设置由于活动呼叫"而使顶部的绿色变为绿色,我徒劳地试图摆脱模拟器的这种情况,因为我正在开会和开发,从而导致了问题,但这是一个好问题,因为随后我正确地布置了UI. /p>

I'm writing application for iOS 4.1+ and I had to add tab bar to view controller programmatically.

Here is the code of main ViewController:

- (void)viewDidLoad
{
     FirstViewVC* vc1 = [[FirstViewVC alloc] init];
     vc1.tabBarItem.title = @"Tab 1";
     AboutVC* vc2 = [[AboutVC alloc] init];
     vc2.tabBarItem.title = @"About Program";
     NSArray* controllers = [NSArray arrayWithObjects:vc1,vc2, nil];
     tabBarController.viewControllers = controllers;
     self.tabBarController.view.frame = [[self view] frame];
     tabBarController.view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight;

     self.view.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleHeight;
     [self.view addSubview:tabBarController.view];
         (...) //deallocs
}

The result looks like this:

http://img152.imageshack.us/img152/5176/nohotspotup.png

Now, if I turn on personal hotspot, everything is sliding down:

http://img528.imageshack.us/img528/9348/img0028y.png

As you can see tabbar is cut off. I've tried many ways of applying resize masks and adding tabbar, but I still can't manage to get this working properly.

Is there a way to fix this?

解决方案

This isn't a bug, it can also occur if you answer the phone and then switch over to your app when the call is still active.

This is something you need. To take into consideration when laying out the UI and make sure that the UI reverts to it's desired state when that bar goes back to the normal size, that's another small thing to take care of.

Also, you can test this probably easier on the simulator if you open up iChat - I guess now you should use the FaceTime app on Mountain Lion, this should set that top bar green because of an "active call", I tried to get rid of this for the simulator in vain because I was conferencing and developing which caused a problem, but a good one, because I then layed out my UI properly.

这篇关于iOS 4.1个人热点按下标签栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆