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.