tags:

views:

22

answers:

1

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 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?

+2  A: 

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.

Henrik P. Hessel