objective c - Embedded .xib appearing in wrong position -


i hoping ios 8 bug (it still might be; works fine in ios 7) i'm still seeing in ios 8 gm seed.

i have categoriesview.xib embedded in detailview.xib. when detailview.xib displayed, placeholder uiview displays in right location, contents of categoriesview.xib appear 72px above they're supposed to. i'm using autolayout. 72px seems 20px status bar + 44px navigation bar + 8px auto layout constraint top of image.

enter image description here

inside categoriesview.xib, there 5 little icons representing each possible category. each icon has width/height constraint , leading space constraint add padding neighbor. typically screen show 1-2 categories, , accomplish this code:

// width constraints part of categoryviewswidthconstraints outlet collection // padding constraints part of categoryviewsspacingconstraints outlet collection  // loop through outlet collection, , set width , padding constraints 0 (int = 0; < self.categoryviewswidthconstraints.count; i++) {     [self.categoryviewswidthconstraints[i] setconstant:0.0];     [self.categoryviewsspacingconstraints[i] setconstant:0.0]; }  // now, categories need show, add width , padding constraints (int = 0; < self.categoryids.count; i++) {     nsnumber *categoryid = self.categoryids [i];     [self.categoryviewswidthconstraints[categoryid.integervalue - 1] setconstant:20.0];     [self.categoryviewsspacingconstraints[categoryid.integervalue - 1] setconstant:8.0]; } 

again, works fine in ios 7.

i thought had working when, inside categoriesview.m, set:

self.contentview.translatesautoresizingmaskintoconstraints = true. 

that gives me correct vertical placement i'm after, unfortunately auto layout errors because thinks categoriesview needs 132px wide. because of this, last category icon gets stretched:

enter image description here

i'm @ loss here. know pretty nuanced, ideas?

i tried think of, , not work.

my solution? created brand new file , reconstructed elements , constraints. , worked perfectly.

so frustrating, things normal. think had transition xcode 5 xcode 6.


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

visual studio 2010 - Connect to informix database windows form application -

android - Associate same looper with different threads -