大佬教程收集整理的这篇文章主要介绍了ios – 组合UIBarButtonItem在进入视图时稍微改变位置,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我认为这是iOS中的一个bug(使用了8.3版本).它只在使用UIBarButtonSystemItemCompose时发生.其他类型的按钮(系统,文本或自定义)不会发生.
复制此错误所需的唯一@L_874_7@是将该ViewController@L_874_7@与将进入视图的视图一起使用:
#import "ViewController.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view,typically from a nib. UIBarButtonItem* composeBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCamera target:nil action:nil]; [self.navigationItem setrightBarButtonItem:composeBarButtonItem animated:YES]; } @end
我已经在GitHub上创建了一个最小的@L_874_7@来重现问题:https://github.com/jvdvleuten/iOSComposeBarButtonItemBug
看起来与此相关:UIBarButtonItems shift position when UINavigationController is presented modally,除了我的错误只出现在使用UIBarButtonSystemItemCompose.
有任何想法吗?
UIBarButtonItem* composeBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:nil action:nil]; UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedspace target:nil action:nil]; negativeSpacer.width = -6; UIBarButtonItem *dumbBarButtonItem = [UIBarButtonItem new]; self.navigationItem.rightBarButtonItems = @[dumbBarButtonItem,negativeSpacer,self.composeBarButtonItem];
以上是大佬教程为你收集整理的ios – 组合UIBarButtonItem在进入视图时稍微改变位置全部内容,希望文章能够帮你解决ios – 组合UIBarButtonItem在进入视图时稍微改变位置所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。