objective c - "setFrame" doesn't work for UIScrollView in iOS -
i've put scrollview in storyboard.
next, in code call
self.scroll.frame = cgrectmake(100, 0, 800, 900);
i suppose scroll should change position (100, 0)
but somehow still remains in original position set in storyboard.
what missing ?
yes won't work view in autolayout system @ if added using storyboard or xib.
if want set frame initialise in code.
@property (nonatomic,strong) uiscrollview *scrollview; _scrollview = [[uiscrollview alloc] initwithframe:cgrectmake(0, 0, 320, 568)];
if want set position in autolayout system should consider updating constraints of view.
self.scrollviewwidthconstraint.constant += 20; [self.scrollview updateconstraints];
Comments
Post a Comment