How would I be able to set the position of a UIBarButtonItem? Like, I would like to set it to be on either the very right of a UIToolbar or the very left depending on a state.
Thank you.
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.
You do not set directly the position of a UIBarButtonItem in an UIToolbar. Instead you defined the items’ order and put flexible space on the left or on the right.
What you can do is:
UIBarButtonSystemItemFlexibleSpace(button 2).setItems:animated:method.setItems:animated:method.