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.

enter image description here

the button alpha. meaning, appears if user clicks upon view. when first appears it's misaligned, so:

enter image description here

but upon click button fine:

enter image description here

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -