ios - How to add a scroll view to the existing view controller? -



ios - How to add a scroll view to the existing view controller? -

i have added lot of ui elements in controller , have done web service part in implementation code. seems default screen size view controller not sufficient me display information. possible add together scroll view existing controller , if yes please give thought or example, can add together more ui elements.

thanks in advance.

try create main view scrollview:

- (void)loadview { // create , configure scrollview uiscrollview *scrollview = [[uiscrollview alloc] initwithframe:self.view.bounds]; self.view = scrollview; }

loadview method subclassed view controllers should configure main view, called automatically before vc loads , shouldn't called directly.

after adding elements scrollview want alter content size scrolls this:

// horizontal scroll [scrollview setcontetsize:cgsizemake(cgrectgetmaxx(lastelementontheright), scrollview.frame.size.height)]; // vertical scroll [scrollview setcontentsize:cgsizemake(scrolview.frame.size, cgrectgetmaxy(lastelementonthebottom))];

ios uiviewcontroller uiscrollview controller scrollview

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -