ios - paste one xib onto another xib -


i want paste blue view onto yellow one.

screenshot

however, no matter how change autolayouts of blue one, there conflicts.

press button in middle, , view show.

xcode project

add line file maned uiviewcontroller+testalert.m

containerframe.size.width = view.frame.size.width; 

just after

containerframe.size.height = view.frame.size.height; 

so code of showalertviewb function

if (show) {     nsarray* nibviews = [[nsbundle mainbundle] loadnibnamed:@"alertviewb" owner:self options:nil];     alertviewb = (alertviewb*)[nibviews objectatindex:0]; //        [alertviewb removeconstraint:alertviewb.containerheightconstraint]; //        nslayoutconstraint *newcontainerheightconstraint = [nslayoutconstraint constraintwithitem:alertviewb attribute:nslayoutattributeheight relatedby:nslayoutrelationequal toitem:nil attribute:nslayoutattributeheight multiplier:1.0 constant:view.frame.size.height]; //        [alertviewb addconstraint:newcontainerheightconstraint];     cgrect containerframe = alertviewb.container.frame;     containerframe.size.height = view.frame.size.height;     containerframe.size.width = view.frame.size.width;     [alertviewb.container setframe:containerframe];      [alertviewb settranslatesautoresizingmaskintoconstraints:yes];     alertviewb.delegate =self;     [alertviewb showwithview:view]; } else {     [alertviewb removefromsuperview];     alertviewb = nil; } 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -