I write a chat module and i need to load previous messages to chat when user scrolling up a chat view. It is so easy to add subview to end of content, but i don’t know how to add subview to start :(.
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.
You will need to shift all the other views down by the height of the new view, you can also add an animation to the motion of the views, for example if you have 5 views, and you want to add an additional view, you will shift these 5 views to the bottom (and maybe apply an animation) then add this new view to the correct postition
However as i suggested in the comments, using a
UITableViewwould be easier, each cell will be aUITableViewCell, and to add a new chat item you would use