HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了iOS 7中的UINavigation Back Button原点大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我创建了自定义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原点所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。