I want to animate UIBarButtonItemin he NavigationBar from left to right when i flip the view. How can i do this.Thanks!
I want to animate UIBarButtonItem in he NavigationBar from left to right when i
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Technically, it shouldn’t be done. You have no access to the UIBarButton that is the backing of the UIBarButtonItem – the item is used as a placeholder for this reason: you shouldn’t be touching the view.
If you wanted to do it anyway, you have two options: either implement the button yourself, using UIButton and the -[UIBarButtonItem intWithCustomView:] method, or hit test the navigation bar for the button located at that location, and move it manually, but setting that view’s frame.
May I stress I don’t recommend the second option, as it is a major hack.
The first option would require you to Unset the button from the navigation bar, add it where it was on top of the navigation bar as a subview, then move it. Once moved, you’d remove it from the navigation bar, put it back in another UIBarButtonItem wrapper, and set it to the navigation item’s right side animated.