How can I position a button on my view dynamically?
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.
Ok, now we understand the question better…
You can place a button/UIComponent at runtime by settings its
frame. This will place it at a given coordinate within the view containing the button.If you wish to do a linear style animation (no curves), look up
CATransitions, see iPhone UIView Animation Best Practice. If you need to support pre-iOS4 devices, you can’t useCATransitions, and have to do it the old way usingUIViewanimations.To do more complex animations, you might have to mess around with timers, which can slightly juddery effects if you’re trying to do complicated animation paths.