开发者

Weird behavior of hidesBottomBarWhenPushed = YES (moves views when popping back)

So I've got something really weird going on here, and can't quite put my figure on it. Basically, I've got a view that has two subvi开发者_运维百科ews: one is to a webview, the other is to a button controller

See here for the bug: http://screencast.com/t/zTjAUP8aXgz

Now when I pushViewController to another controller and pop back, everything works fine, except when I pushViewController to a certain view controller (the one with the magnifying glass). When I do that, I see the following bugs:

  1. the webview gets 20 pixels shorter
  2. the button controller gets pushed up 7-8 pixels.

I've isolated it down to the fact that when the tab bar is hidden (with hidesBottomBarWhenPushed = YES), the bug is no longer seen:

http://screencast.com/t/VARgPr4u

What could cause this? Is it a bug in hidesBottomBarWhenPushed ? If so, how can I compensate for it?


With a little bit of debugging, I ended up finding out that the subview in question was growing by 10 px, as well as being shifted up by -5.

I wasn't updating the height of that view anywhere - a coworker suggested I turn off autoresizesSubviews (which I did in the nib of the parent controller). That fixed the issue.

Presumably, the parent (containing) controller's view bounds had changed, although I saw no evidence of this in the debugger.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜