ios - IBOutlet constraints won't align button upon load in iPad application -
i have uibutton that's presented on top of view (both created via xib). constraints uibutton placed programmatically.
the button alpha. meaning, appears if user clicks upon view. when first appears it's misaligned, so:
but upon click button fine:
i've traced autolayout stack in console , there no signals of ambiguity. not sure problem since isn't code. i'm thinking deleting button , reimplementing since constraints created via iboutlet other programmer (shoot me in head).
here's code:
the below establishes buttons state when it's clicked on. reason why i've included because properties _primarytrailing , _primaryaligncenterx both nslayoutconstraints.
- (void)setstate:(kstepstate)state { _state = state; switch (state) { case kstepstatewatchmodel: [self setinstruction:@"watch model scenario part" primarytitle:@"model scenario" secondarytitle:nil]; _primarytrailing.active = no; _primaryaligncenterx.active = yes; break; case kstepstatepractice: [self setinstruction:@"start first practice activity part" primarytitle:@"practice" secondarytitle:@"model scenario"]; break; case kstepstateviewpractices: [self setinstruction:@"pick left off" primarytitle:@"my practices" secondarytitle:@"model scenario"]; break; // case : // [self setinstruction:@"need refresher? (placeholder copy)" // primarytitle:@"model scenario" // secondarytitle:nil]; // break; case kstepstatewatchsubmission: [self setinstruction:@"view submission part" primarytitle:@"my submission" secondarytitle:@"model scenario"]; break; // case : // [self setinstruction:@"resubmit part" // primarytitle:@"my submission" // secondarytitle:nil]; // break; default: break; } }
Comments
Post a Comment