【问题标题】:UITabBar customizationUITabBar 自定义
【发布时间】:2011-02-03 20:28:36
【问题描述】:

这看起来很遥远,但有谁知道以下方法:

  1. 在屏幕顶部放置一个 UITabBar
  2. 改变它的高度

欢迎您推荐私有 API 方法

【问题讨论】:

    标签: objective-c cocoa-touch uikit uitabbarcontroller uitabbar


    【解决方案1】:

    您不需要私有 API,只需在您的 applicationDidFinishLaunching 方法中尝试即可。

    controller = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
    
    HeadlinesViewController *headlines = [[HeadlinesViewController alloc] init];
    OpinionsViewController *opinions = [[OpinionsViewController alloc] init];
    
    controller.viewControllers = [NSArray arrayWithObjects:headlines, opinions, nil];
    
        // set your position , width and height there
    controller.tabBar.frame = CGRectMake(0, 20, 320, 50);
    [window addSubview:controller.view ];
    [window makeKeyAndVisible];
    

    【讨论】:

      【解决方案2】:

      我刚刚写了一个类别来改变tabbar的高度

      您可以查看UITabBar height in iOS 5

      希望对你有帮助:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-09-15
        • 1970-01-01
        • 2010-10-15
        • 2011-05-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多