从TTThumbsViewController返回后,UIButton向上移动
问题描述:
我有一个UIViewController,它有一个UIButton。从TTThumbsViewController返回后,UIButton向上移动
我放入UIButton的事件是加载一个新的TTThumbsViewController PhotoThumbnail。
PhotoThumbnail *photoThumbnail = [[PhotoThumbnail alloc] initWithNibName:@"PhotoThumbnail" bundle:nil];
[self.navigationController pushViewController:photoThumbnail animated:YES];
点击UIButton后,PhotoThumbnail完美载入。
问题:当我点击Back按钮时,视图返回UIButton的位置,但UIButton的位置向上移动!
任何想法是什么导致这个UIButton移动?
注意:UIViewController是UITabBarController的一部分,它最终被添加到窗口中。
的tabBarController被添加到窗口
[window addSubview:tabBarController.view];
希望我在这里我的情况解释清楚。
答
我找到了解决方案!排序... ...一个解决办法...
解决的办法是,在Interface Builder,设置按钮 “自动调整大小”
从:顶部(选择),左(选择),右(未选),底部(未选)。所有按钮都物理设置在视图顶部。
to:Top(UnSelected),Left(UnSelected),Right(Selected),Bottom(Selected)。然后将按钮从顶部移开(按估算)。
P.S.不确定这是我的设计问题还是与其他一些错误或其他问题有关!希望这有助于其他人!
或者:如果有人知道这个的真正原因,随时发表评论!谢谢!