iOS 7中的UINavigation Back Button原点

iOS 7中的UINavigation Back Button原点,第1张

概述我创建了自定义UINavigation Back Button.但是iOS 6和iOS 7中按钮的来源不同. iOS 6外观: iOS 7外观: 如何在iOS 7中设置UINavigation Back Button原点与iOS 6中的相同? 使用此代码修复左栏按钮位置: //First add the following macro: #define SYSTEM_VERSION_GRE 我创建了自定义UINavigation Back button.但是iOS 6和iOS 7中按钮的来源不同.

iOS 6外观:

iOS 7外观:

如何在iOS 7中设置UINavigation Back button原点与iOS 6中的相同?

解决方法 使用此代码修复左栏按钮位置:

//First add the following macro:    #define SYstem_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)    //Then customize your navigation bar:    - (voID) initNavigationbar    {        UIbarbuttonItem *negativeSpacer = [[UIbarbuttonItem alloc] initWithbarbuttonSystemItem:UIbarbuttonSystemItemFixedspace target:nil action:nil];        if (SYstem_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))        {            negativeSpacer.wIDth = -10;        }        else        {            negativeSpacer.wIDth = 0;        }        UIbarbuttonItem *backbutton = [[UIbarbuttonItem alloc] initWithCustomVIEw:_customBackbutton];        self.navigationItem.leftbarbuttonItems = @[negativeSpacer,backbutton];    }
总结

以上是内存溢出为你收集整理的iOS 7中的UINavigation Back Button原点全部内容,希望文章能够帮你解决iOS 7中的UINavigation Back Button原点所遇到的程序开发问题。

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

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

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

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

发表评论

登录后才能评论

评论列表(0条)

保存