Adding and switching between subviews
I have a View which I want to have a label and 2 buttons on the top in a panel. This area wouldnt change.
Instead of new view and Xib files and setting their position to below the main view, I would like开发者_StackOverflow to know how one can add a subview to the main view so that the subview can change and be modified.
Or is it better to go with separate views?
Did you try the standard way?
CGRect myFrame = CGRectMake(0, 0, 320, 30);
UIView *myView = [[UIView alloc] initWithFrame:myFrame];
myView.backgroundColor = [UIColor blackColor];
[self.view addSubview:myView];
[myView release];
Your new View will overlap your current view.
精彩评论