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

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -