0

我有一个 UIViewController,里面有一个 UIButton。

我在 UIButton 中放置的事件是加载一个新的 TTThumbsViewController PhotoThumbnail。

PhotoThumbnail *photoThumbnail = [[PhotoThumbnail alloc] initWithNibName:@"PhotoThumbnail" bundle:nil];  
[self.navigationController pushViewController:photoThumbnail animated:YES];

单击 UIButton 后,PhotoThumbnail 完美加载。

问题:当我点击后退按钮时,视图返回到 UIButton 的位置,但 UIButton 的位置向上移动了!

知道是什么导致这个 UIButton 移动吗?

注意:UIViewController 是 UITabBarController 的一部分,最终添加到窗口中。

tabBarController 被添加到窗口中

[window addSubview:tabBarController.view];

希望我在这里对我的情况的解释很清楚。

4

1 回答 1

1

I found the solution! Sort of... a workaround...

The solution is, in Interface Builder, set the buttons "Autosizing"

from: Top (Selected), Left (Selected), Right (UnSelected), Bottom (UnSelected). All buttons are physically set on top of the view.

to: Top (UnSelected), Left (UnSelected), Right (Selected), Bottom (Selected). Then move the buttons away from the top (by estimate).

P.S. Not really sure if this is my design problem or related to some other bugs or other issues! Hope this helps other people!

Or: If anyone knows the actual reason to this, feel free to comment! Thanks!

于 2011-03-10T14:50:42.757 回答