IOS8 new feature Tableviewcell adaptive height iphone5siphone6 and iphone6p difference settings

Source: Internet
Author: User

Arrogant IOS8 introduced the TableView adaptive height, I have always wanted to try, just have a news app need to use to try the next.

Use the process many blogs have mentioned, pull a cell in the storyboard and then set the elements inside the constraints. I do this a lot. Note the last element to be set to the bottom of the constraint.

I'm not going to tick in the storyboard.

And that's how it turns out.

iphone6p on all normal:

The highly adaptive TableView on IPhone5 and IPhone6 did not succeed:

If I make this tick,

Look again at the iphone6p:

On IPhone5S or IPhone6:

To summarize, that is to say

Preferred width Yes No
iphone6p
Exception

Normal
IPhone5S or IPhone6 Normal Abnormal

Of course, the size of the preferred width is also related to whether the page is normal. If the setting is larger than the screen width, then even if selected, the problem will still occur on iphone5s or 6.

The solution I'm giving you here is

1. Do not select

2. Add the following code in the awakefromnib of the custom cell. By judging the model to adapt to the adaptive.

    if 414 ) {        =$;        [Self.commentlabel Setpreferredmaxlayoutwidth:premaxwaith];    }

IOS8 new feature Tableviewcell adaptive height iphone5siphone6 and iphone6p difference settings

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.