I have two UIViews in scrollview where both the views has subviews with Autolayout OFF under it
- MainView
- ScrollView
- UIView
-UIButtons
-UIButtons
- UIView
- Navigation Bar
- UIImageView
- UIImageView
The first UIView
under ScrollView
has UIButtons
which is going to be dynamic depending upon that I want to set the height and position of the second view`.
say if there are three buttons then the next UIView
should go down w.r.t to the height of the first UIView
.
While trying to achieve this I am not able to set the height of UIView
at runtime?
EDIT: Here's what I am doing I am changing the content size of scrollview:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// CGRect frame = self.myGamesSection.frame;
// frame.size.height = 100.0f;
// self.myGamesSection.frame = frame;
}
-(void) viewDidAppear:(BOOL)animated {
CGSize rSize = CGSizeMake(320.0f,1200.0f);
self.scrollView.contentSize = rSize;
}
-(void) viewWillAppear:(BOOL)animated {
CGSize rSizeMyGames = CGSizeMake(320.0f,100.0f);
self.myGamesSection.frame = CGRectMake(0,47,320, 100);
}