我還沒有花足夠的時間查看TTLauncherView背後的代碼,但它在橫向模式下似乎在右側有一個空白區域。我正在考慮重寫啓動器,但任何人都有更優雅的解決方案?我想刪除空白區域,而是將項目重新組織到該空白區域。在iPad橫向模式下的TTLauncherView在右側有一個空白區域
0
A
回答
1
我認爲你可以做到這一點有很多比這更容易......我是很新,這個工具包,但這似乎在我的應用程序的工作:
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[self.view setBackgroundColor:[UIColor clearColor]];
}
-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[_launcherView setFrame:self.view.bounds];
}
編輯: 對編輯,我只是找到更好的方法來做到這一點。我們可以重寫一個動畫方法,該方法可以自動動畫TTLauncherItems的旋轉。我已經改變了視圖的alpha值來隱藏圖標旋轉的陡峭性:
-(void) willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[_launcherView setFrame:self.view.bounds];
//[self.view setAlpha:0.4];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.1];
[self.view setAlpha:1];
[UIView commitAnimations];
}
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
[self.view setBackgroundColor:[UIColor clearColor]];
[self.view setAlpha:1];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.1];
[self.view setAlpha:0.7];
[UIView commitAnimations];
}
0
這可以更容易完成。我喜歡這個沒有使用willRotate方法的解決方案:
-(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[UIView beginAnimations:nil context:NULL];
[_launcherView setFrame:self.view.bounds];
[UIView commitAnimations];
}
它爲我工作!
相關問題
- 1. 當我擁有一個滑塊時,右側的空白區域
- 2. 爲什麼在橫向模式下隱藏的TabBar顯示空白區域?
- 3. UIModalPresentationFormSheet在橫向模式下的iPad
- 4. 屏幕方向更改後頁面右側的空白區域
- 5. 如何確定橫向模式下iPad右下角的座標?
- 6. 使用bootstraps創建的導航欄在左側和右側有空白區域
- 7. 主頁右側的空白區
- 8. 而在橫向模式在iPad上
- 9. Ipad以肖像模式居中,在橫向模式下工作
- 10. SSRS報告 - 刪除右側空白區
- 11. 在iPad中鎖定橫向模式
- 12. 在橫向和縱向模式下啓動iPad應用程序
- 13. 頁面右側的空白
- 14. 頁面的空白右側
- 15. 如何在div的左側和右側有一個可平鋪區域?
- 16. 在ipad橫向模式下的Helvetica字體變化
- 17. HTML:在屏幕的左側和右側有文本區域
- 18. 如何在縱向模式下創建2列,在橫向模式下創建3個iPad佈局?
- 19. iPhone應用程序在橫向模式下打開iPad上
- 20. 如何在橫向模式下製作ipad應用程序
- 21. HTML CSS佈局在iPad橫向模式下縮小?
- 22. Android - LinearLayout右側和右側的空白空間
- 23. glBlitFramebuffer,內容是在橫向模式下,iOS設備(5S和iPad空氣)
- 24. 需要在下一個空白區域粘貼信息
- 25. 印刷在IE11在橫向模式下
- 26. 爲什麼右側有空白?
- 27. WPF:黑色區域在窗口右側
- 28. 爲什麼在我的css左邊有一個空白區域
- 29. 在橫向模式下隱藏狀態欄旋轉時留出空白
- 30. 即使ipad面向橫向顯示橫向右視圖
我有你可以繼承TTLaucherView並添加橫向支持。我可以證實,這並不是那麼快。 – MacTeo 2011-03-02 07:18:02