【问题标题】:Strange behavior of the UIBarButtonItem with Accessibility Button Shape具有辅助功能按钮形状的 UIBarButtonItem 的奇怪行为
【发布时间】:2016-12-21 11:39:40
【问题描述】:

应用程序在self.navigationItem.leftBarButtonItem 中成功显示UIBarButtonItem

这样创建的按钮。

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:Localized(kSelect) style:UIBarButtonItemStylePlain
                                                                        target:self action:@selector(onSelectButtonPressed:)];

只有当我在辅助功能中启用启用按钮形状leftBarButtonItem 正在消失但仍处于活动状态并且我可以选择此按钮时,一切才能正常工作。脱袋后,可以突出显示按钮文本已更改为白色。

【问题讨论】:

    标签: ios objective-c xcode uiaccessibility


    【解决方案1】:

    使用UIButton,然后根据需要对其进行自定义,然后从中实例化UIBarButtonItem

    UIButton *myBtn = [[UIButton alloc] init];
    //
    // do your necessary customisation on myBtn
    //
    
    UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithCustomView:myBtn];
    

    【讨论】:

      猜你喜欢
      • 2022-11-30
      • 1970-01-01
      • 1970-01-01
      • 2012-06-13
      • 1970-01-01
      • 1970-01-01
      • 2020-03-09
      • 2017-06-09
      • 1970-01-01
      相关资源
      最近更新 更多