zoukankan      html  css  js  c++  java
  • 解决iOS9下隐藏App返回按钮文字导致的诡异闪屏问题

    问题的原因竟是一行代码导致的,这行代码的作用是隐藏App返回按钮的文字。

    看看这有问题的代码: 

    //将返回按钮的文字position设置不在屏幕上显示 [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(NSIntegerMin, NSIntegerMin) forBarMetrics:UIBarMetricsDefault];

    作用应该是对返回按钮Title进行无穷大的负偏移,使返回按钮Title消失在屏幕显示区域的无穷远处。

    解决方案:1

    设置返回按钮Title为透明颜色

    [[UIBarButtonItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor clearColor]} 
                                  forState:UIControlStateNormal];

    解决方案:2

    设置返回按钮Title为透明颜色

     其中的kScreenWidth和kScreenHeight分别是屏幕宽度与高度
     [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-kScreenWidth, -kScreenHeight) forBarMetrics:UIBarMetricsDefault];
     
  • 相关阅读:
    批处理操作
    注册表操作
    js 表格操作(兼容模式
    asp解码.net传参
    windows+nginx 查看并发链接数
    windows+nginx负载测试
    开发cocos2dx真机插件遇到问题,以及心得
    react路由
    Redux实现原理解析及应用
    test
  • 原文地址:https://www.cnblogs.com/haijieFeng/p/5486491.html
Copyright © 2011-2022 走看看