Use Mansard to set constraints on the cell's child controls, and automatically calculate the cell height problem, iOS7 warning

Source: Internet
Author: User

Mansory set the cell child control to open the cell contentview from top to bottom, the calculation can automatically calculate the height, but iOS7 will report the following warning

Probably at least one of the constraints in the following list are one you don ' t want. Try this: (1) Look at the each constraint and try to figure out which you don ' t expect; (2) Find the code that added the unwanted constraint or constraints and fix it. (Note:if you ' re seeing nsautoresizingmasklayoutconstraints so you don ' t understand, refer to the documentation for the UIView Property translatesautoresizingmaskintoconstraints)

(

"<maslayoutconstraint:0x179e9210 uilabel:0x1673d3d0.height = = 14.316>",

"<maslayoutconstraint:0x1670dd90 uilabel:0x1673d3d0.top = = uitableviewcellcontentview:0x179d32e0.top>",

"<maslayoutconstraint:0x1798e460 Uiview:0x179df8e0.top = = Uilabel:0x1673d3d0.bottom + 10>",

"<maslayoutconstraint:0x179d57b0 Uiview:0x179df8e0.bottom = = uitableviewcellcontentview:0x179d32e0.bottom-25 > ",

"<nsautoresizingmasklayoutconstraint:0x178c4980 uitableviewcellcontentview:0x179d32e0.height = = 44>"

)

The last word is that the original 44 default constraints and some existing conflicts, the solution is

- (Id)Initwithstyle:(Uitableviewcellstyle)Style Reuseidentifier:(NSString *)Reuseidentifier{ Self = [SuperInitwithstyle:UitableviewcellstyledefaultReuseidentifier:Reuseidentifier]; If (Self) { Selfcontentview.= uiviewautoresizingflexibleheight| uiviewautoresizingflexiblewidth;//** This sentence is important [self Createsubviews]; } return self;} 
http://stackoverflow.com/questions/19132908/ Auto-layout-constraints-issue-on-ios7-in-uitableviewcell

Use Mansard to set constraints on the child controls of the cell, and automatically calculate the cell height problem, iOS7 warning

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.