Strange behavior of the UIBarButtonItem with Accessibility Button Shape

212 views Asked by At

Application shows UIBarButtonItem in the self.navigationItem.leftBarButtonItem successfully.

Button created like this.

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

And everything works fine only when i enable Enable Button Shapes in Accessibility leftBarButtonItem is disappearing but is still active and i can select this button. After debagging it is possible to highlight that button text is changed to the white.

1

There are 1 answers

0
Ratul Sharker On BEST ANSWER

Use the UIButton and then customise it according to your need, then instantiate UIBarButtonItem from it.

UIButton *myBtn = [[UIButton alloc] init];
//
// do your necessary customisation on myBtn
//

UIBarButtonItem *barBtn = [[UIBarButtonItem alloc] initWithCustomView:myBtn];