Details of the WeChat moments review function, and details of the moments review function

Source: Internet
Author: User

Detail consideration and implementation of the circle of friends comment function, details of the circle of friends comment function
1. circle of friends

The layout of the circle of friends is very easy, and there are a lot of similar code on the Internet, but some details of the comment function should be considered, mainly for the user experience.

Similar to the keyboard, do not block comment boxes. As the content increases, there are many ways to handle these online content, which will not be listed here.

As long as you press the comments in the circle of friends, the dialog box is raised to the bottom of the page. This small detail has a very good user experience, and there are many implementation methods, the following describes the implementation method.

2. Implementation of comment details

My method is to save the coordinates y at the end of the cell where the button is located when you press the comment button.

self.replyViewDraw = [cell convertRect:cell.bounds toView:self.view.window].origin.y + cell.frame.size.height;

Then, when the keyboard is upgraded, the comment box is also raised to the top of the keyboard. At this time, the coordinate y of the keyboard minus the position y saved above is the position where tableView needs to be moved.

How to move the comment box: Change frame. origin. y

How to move tableview: Change contentOffset. y

[UIView animateWithDuration:[dic[UIKeyboardAnimationDurationUserInfoKey] floatValue] animations:^{                        [UIView setAnimationCurve:[dic[UIKeyboardAnimationCurveUserInfoKey] doubleValue]];                        CGRect frame = self.replyInputView.frame;            frame.origin.y = frame.origin.y - keyboardRect.size.height + 52;            self.replyInputView.frame = frame;                        CGPoint point = self.familyTableView.contentOffset;                        point.y -= (frame.origin.y - self.replyViewDraw);            self.familyTableView.contentOffset = point;        }];
3. circle of friends

The functions of the circle of friends are basically implemented, and many details are taken into consideration. If you are interested, you can download them and check them out.

Github address: https://github.com/stevenxiaoyang/familyGroup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.