UITabBar隐藏时会留下一个白色矩形 [英] UITabBar leaves a white rectangle when hidden

查看:85
本文介绍了UITabBar隐藏时会留下一个白色矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直无法通过谷歌搜索可以应用于我的项目的解决方案.

I have been unable to google an acceptable solution to this that can be applied to my project.

我的应用程序是一个图形工具,具有三个选项卡.一个用于图本身,另外两个用于图的浏览/搜索功能,可以添加到图中.所有标签都是导航控制器.

My app is a graphing tool that has three tabs; one for the graph itself and the other two are for browse/search functions for things that can be added to the graph. All tabs are navigation controllers.

在纵向模式下,图形本身的选项卡显示图形的小预览并列出下面图形中每个实体的详细信息,并在底部显示选项卡栏.

The tab for the graph itself, when in portrait mode, displays a small preview of the graph and lists details of each entity that is on the graph below, and displays the tab bar at the bottom.

当用户旋转到横向模式时,图形将变为全屏显示,并且其他所有内容(包括标签栏)都将消失.这就是我遇到的问题,因为图形的GLView总是被选项卡栏所在的白色矩形遮盖.

When the user rotates into landscape mode the graph turns full screen and everything else, including the tab bar, disappears. This is where I'm having the problem, as the GLView for my graph is always obscured by a white rectangle where the tab bar was.

我尝试将导航控制器视图的大小更改为全屏,将标签栏控制器视图的大小更改为全屏,将标签栏本身的框架大小更改为CGRect(0,0,0, 0),情绪激动,在桌上敲打拳头,在MacBook上大吼大叫语言等;全部无济于事.

I have tried changing the size of the navigation controllers view to full screen, changing the size of the tab bar controllers' view to full screen, changing the frame size of the tab bar itself to CGRect(0,0,0,0), becoming emotionally distraught, banging my fists on the desk, shouting abusive language at the MacBook, etc; all to no avail.

我如何使它工作?

推荐答案

我遇到了这个问题,并且通过更改内容视图的标签栏的子视图框架(标签栏中有2个子视图-内容视图(# 0)和条形图(#1)):

I had this problem, and I've resolved it by changing tabbar's subview frame for my content view (there are 2 subviews in tab bar - content view (#0) and bar view (#1)):

[[self.tabBarController.view.subviews objectAtIndex:0] setFrame:FULLSCREEN_FRAME];

这篇关于UITabBar隐藏时会留下一个白色矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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