【问题标题】:Present TTTabbar Vertically垂直呈现TTTabbar
【发布时间】:2012-02-27 08:54:23
【问题描述】:

我想创建一个 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);

【问题讨论】:

  • 您究竟是如何尝试旋转它的?请出示您的代码。 “没有运气”是什么意思?你收到错误了吗?应用崩溃了吗?
  • 您究竟是如何尝试旋转它的?请出示您的代码。 “它延伸”是什么意思。如果你有什么帮助,请提供信息。

标签: iphone xamarin.ios three20


【解决方案1】:

好的,看起来TTTabBar 真的不喜欢这样旋转。这是因为它的内部实现。最简单的解决方法是旋转父视图。如果在您的情况下无法做到这一点,请在 tabBar 周围环绕一个新视图并旋转该视图。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-26
    • 2017-08-17
    • 2011-10-16
    • 2015-07-31
    • 1970-01-01
    相关资源
    最近更新 更多