2012-02-27 33 views
0

我想要創建一個TTTabbar,它將以垂直方式顯示,而不是默認顯示。縱向呈現TTTabbar

我到目前爲止嘗試用cgaffinetransformmakerotation旋轉TTTabbar,但沒有運氣。當我旋轉它時,它伸展。

有什麼建議? :)

[編輯]

我不得不把TTtabbar添加到一個UIView,否則tttabbar綿延整個屏幕

this.rightView = new UIView(); 
this.rightView.BackgroundColor = UIColor.ScrollViewTexturedBackgroundColor; 
RectangleF applicationFrame = UIScreen.MainScreen.ApplicationFrame; 

//applicationFrame.Y -=20; 

TTTabBar ttTabBar = new TTTabBar(new RectangleF(0,0,applicationFrame.Height,40)); 
ttTabBar.TabItems = NSArray.FromNSObjects(new TTTabItem("one"),new TTTabItem("two"),new TTTabItem("three")); 

rightView.Frame = new RectangleF(110,applicationFrame.Height/2,applicationFrame.Height,40); 

this.rightView.AddSubview(ttTabBar); 
rightView.Transform = CGAffineTransform.MakeRotation((float)(Math.PI*90)/180); 
+0

您究竟如何旋轉它?請顯示你的代碼。 「沒有運氣」是什麼意思?你收到錯誤了嗎?應用程序崩潰了嗎? – tonklon 2012-02-27 09:32:14

+0

沒有崩潰,它延伸 – Janub 2012-02-27 10:00:03

+0

你究竟如何旋轉它?請顯示你的代碼。 「它延伸」是什麼意思?如果你有什麼幫助,請提供信息。 – tonklon 2012-02-27 10:12:32

回答

0

OK,貌似TTTabBar確實不喜歡像這樣旋轉。這是因爲它是內部實施。最簡單的解決方法是旋轉父視圖。如果在你的情況下這是不可能的,圍繞tabBar包圍一個新的視圖,並旋轉該視圖。