ios - Please explain the following auto layout behavior to me -


i'm trying figure out doing wrong following constraint-based uitableviewcell layout (ios 8).

my cell laid out shown in image:

enter image description here

there image view on left, label on right, , both should touching cell margins everywhere. image has fixed size (64x64), label's height smaller that. want image's height cause cell expand height correct value (image height + 2 * margin).

the problem this: have 3 constraints vertical size, v[image(64)], reset.bottom == uitableviewcellcontentview.bottommargin , reset.top == uitableviewcellcontentview.topmargin (all defined via storyboard). when display cell, unsatisfiable constraints error. uiview-encapsulated-layout-height constraint interferes constraints, , auto layout breaks image view height constraint. looks should, don't errors @ runtime.

if give height constraint priority 999, looks fine, no errors.

so understanding is, height constraint broken in both cases @ runtime.

but when delete height constraint altogether, image displays @ original height (the file has different resolution display in cell). why this, or getting wrong here?

edit/update: noticed wrong working. initial display of cell fine, when cell changes (in case moving another, simple single line label, cell below it) cell changes height default row height (44 pts), squashing image in process. happens in both cases, when auto layout breaks constraints or when reduce priority of height 999. i'm @ loss how these cells want.

you should try setting estimatedrowheight property in code, , also, depending on version of ios 6 you're using, set rowheight property uitableviewautomaticdimension,

self.tableview.estimatedrowheight = 44; self.tableview.rowheight = uitableviewautomaticdimension; 

the default rowheight nib or storyboard table views, supposed changed uitableviewautomaticdimension @ point; don't know if has yet in 6.0.1, last line may or may not necessary.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -