ios - How to constrain view's width to device width in interface builder? -


i have view hierarchy

enter image description here

i want content grow vertically in content view not horizontally. want constrain contentview's width same device's width. how can in interface builder?

note: image's width in image view bigger device's width, right contentview's size grows both vertically , horizontally

just add constraints content view leading space,trailing space,top space,bottom space along fix content view width constraint constant , create outlet width constraint value , in view controller side write method as

-(void)viewdidlayoutsubviews {

_scrollviewcontentviewwidthconstraint.constant = self.view.frame.size.width;

}


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -