我有一个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];
希望我在这里解释我的情况很清楚。
答案 0 :(得分:1)
我找到了解决方案! ......解决方法......
解决方法是在Interface Builder中设置“Autosizing”按钮
from:Top(Selected),Left(Selected),Right(UnSelected),Bottom(UnSelected)。所有按钮都物理设置在视图的顶部。
to:Top(UnSelected),Left(UnSelected),Right(Selected),Bottom(Selected)。然后将按钮从顶部移开(按估计值)。
P.S。不确定这是我的设计问题还是与其他一些错误或其他问题有关!希望这有助于其他人!
或者:如果有人知道这个的实际原因,请随时发表评论!谢谢!