开发者

UIBarButtonItem normal and pressed states switched?

开发者 https://www.devze.com 2023-01-21 22:48 出处:网络
I created a toolbar with a translucent black style like so: UIToolbar *too开发者_JS百科lbar = [UIToolbar new];

I created a toolbar with a translucent black style like so:

UIToolbar *too开发者_JS百科lbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlack;
toolbar.translucent = YES;

I created a button item for it:

UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithImage:nil
                            style:UIBarButtonItemStyleBordered
                          target:self
                            action:@selector(mySelector:)];

I noticed that the button when in normal state appears light grey and turns to full black only when I press on it. This seems to be the opposite of how it should function (e.g. Photo app). I'd like it do be black in normal state and lighter when pressed. What am I missing?


Change the barstyle to UIBarStyleBlackTranslucent, as dumb as it sounds, and I believe it returns it to normal.

0

精彩评论

暂无评论...
验证码 换一张
取 消