2011-03-08 106 views
0

我有一個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]; 

希望我在這裏我的情況解釋清楚。

回答

1

我找到了解決方案!排序... ...一個解決辦法...

解決的辦法是,在Interface Builder,設置按鈕 「自動調整大小」

:頂部(選擇),左(選擇),右(未選),底部(未選)。所有按鈕都物理設置在視圖頂部。

to:Top(UnSelected),Left(UnSelected),Right(Selected),Bottom(Selected)。然後將按鈕從頂部移開(按估算)。

P.S.不確定這是我的設計問題還是與其他一些錯誤或其他問題有關!希望這有助於其他人!

或者:如果有人知道這個的真正原因,隨時發表評論!謝謝!