ios – 将UITabBar定位在顶部

ios – 将UITabBar定位在顶部,第1张

概述我是iOS开发的初学者.我的问题是:是否可以将UITabBar置于顶部,如何? 我无法将UITabBar放置在视图的顶部. 可能吗?当然,但是它违反了人机接口指南. 截图:    码: TabController.h: #import <UIKit/UIKit.h>@interface TabController : UITabBarController <UITabBarController 我是iOS开发的初学者.我的问题是:是否可以将UITabbar置于顶部,如何?
我无法将UITabbar放置在视图的顶部.解决方法 可能吗?当然,但是它违反了人机接口指南.

截图:

码:

TabController.h:

#import <UIKit/UIKit.h>@interface TabController : UITabbarController <UITabbarControllerDelegate>@end

TabController.m:

#import "TabController.h"@interface TabController ()@end@implementation TabController- (voID)vIEwDIDLoad{    [super vIEwDIDLoad];    self.delegate = self;}- (voID)vIEwWillLayoutSubvIEws{    [super vIEwWillLayoutSubvIEws];    [self.tabbar invalIDateIntrinsicContentSize];    CGfloat tabSize = 44.0;    UIInterfaceOrIEntation orIEntation = [UIApplication sharedApplication].statusbarOrIEntation;    if (UIInterfaceOrIEntationIsLandscape(orIEntation))    {        tabSize = 32.0;    }    CGRect tabFrame = self.tabbar.frame;    tabFrame.size.height = tabSize;    tabFrame.origin.y = self.vIEw.frame.origin.y;    self.tabbar.frame = tabFrame;    // Set the translucent property to NO then back to YES to    // force the UITabbar to reblur,otherwise part of the    // new frame will be completely transparent if we rotate    // from a landscape orIEntation to a portrait orIEntation.    self.tabbar.translucent = NO;    self.tabbar.translucent = YES;}- (voID)dIDReceiveMemoryWarning{    [super dIDReceiveMemoryWarning];}@end
总结

以上是内存溢出为你收集整理的ios – 将UITabBar定位在顶部全部内容,希望文章能够帮你解决ios – 将UITabBar定位在顶部所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1108518.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存