Imitation QQ Chat Layout--ios

Source: Internet
Author: User

Although registered blog Park so long, but rarely write something on this, one is also feel that their ability is not enough, and secondly afraid of fraught, so has been holding "more see, do more, less said" principle in each forum. But for a long time, I think this is actually a way to escape. Reasoning, those who are really good people are those who can express themselves in the mind completely, let the person look comfortable, listen to the identity of the people. Therefore, in addition to "look more, do more, less" outside, afraid to add a "more summary", or fear of drowning in the tide of information.

Recently to QQ, chat layout interest, then search data try to engage in, take advantage of the gap, first on, hollow again add explanation.

The general idea is to customize the Tableviewcell (including ImageView and UIButton) by selecting the button because he can either set the background or display the text, if only the text is displayed with a label.

The following is the approximate framework:

  

  

To solve the difficulty is how to achieve the cell height with the size of the text display, IOS7 abandoned the original SizeWithFont:constrainedToSize:lineBreakMode: method, using the Boundingrectwithsize :(cgsize) Size options: (nsstringdrawingoptions) Options attributes: (nsdictionary *) attributes Context: ( Nsstringdrawingcontext *) The method of the context.

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.