Reputation: 11
I have a UIViewController, which have a UIButton in it.
The event I put in the UIButton is to load a new TTThumbsViewController PhotoThumbnail.
PhotoThumbnail *photoThumbnail = [[PhotoThumbnail alloc] initWithNibName:@"PhotoThumbnail" bundle:nil];
[self.navigationController pushViewController:photoThumbnail animated:YES];
After clicking on the UIButton, the PhotoThumbnail loads perfectly.
Problem: When I clicked on the Back button, the view goes back where the UIButton was, but the position of the UIButton moved up!
Any idea what is causing this UIButton to move?
Note: The UIViewController is part of a UITabBarController, which is finally added to the window.
The tabBarController is added to the window
[window addSubview:tabBarController.view];
Hope my explanation of my situation here is clear.
Upvotes: 0
Views: 336
Reputation: 11
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!
Upvotes: 1