-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UIBarButtonItem with customView doesn't work with usesLargeTitle #503
Comments
Hi @jpanchal, I think you are hiring a limitation on the current largeTitle view which it tried to make it easier for clients to utilize UIBarButtonItem of the UINavigationBar but because we are redrawing/positioning barButtonStack by recreating button but there isn't a way to copy the customView of the barButtonItem to show in 2 different places. What's the scenario that you need to custom button here? You could try to create an new api in |
Hi @harrieshin, thanks for the response. I have an alert icon in rightBarButton and I need to show a badge on top corner on this icon. In order to do that, I need to get access to this view inside rightBarButtonItems. How do I get access to the UIView which is copied inside rightBarButtonItemsStackView? |
You would need to write code to expose that and handle marshaling between barbuttonitem and customview that client directly inserted. |
@harrieshin is it possible currently without updating the SDK source code? |
I am trying to use customView for rightNavigationItem along with "usesLargeTitle"
viewController.navigationItem.usesLargeTitle = true
var btn: UIBarButtonItem {
let button = UIButton(type: .custom)
button.setImage(UIImage(named: "Alert"), for: .normal)
button.frame = CGRect(x: 0, y: 0, 20, height: 20)
button.addTarget(self, action: #selector(handler), for: .touchUpInside)
return UIBarButtonItem(customView: button)
}
viewController.navigationItem.rightBarButtonItems = [btn]
So when this property is set, it hides the customView behind other blocked views. Any button set inside customView does not show in view stack.
Any suggestions?
The text was updated successfully, but these errors were encountered: