ios - navigationItem.titleView blinks when updated

2019-07-20 09:05发布

I have a UIView, holding a UIButton, set as my navigationItem.titleView. When I update the text for this button, it briefly blinks (disappearing and reappearing with the new text.)

Is there anyway to keep it visible when it's changed? So, if I change 2015-2016 it appears as if only the last digit is updated to 6?

Thanks

1条回答
闹够了就滚
2楼-- · 2019-07-20 09:44

I solved my problem. This has more to do with UIButton than anything in the navigationBar's titleView.

If a UIButton is set as [yourButton buttonWithType:UIButtonTypeCustom], then it will not blink when it has been updated with [yourButton setTitle:@"title" forState:UIControlStateNormal];

查看更多
登录 后发表回答