Hi,
I have created a UIViewController class with a background color as red. I have also created a UIView which is a subview and placed with a background image and two UIButtons on them. The coding which i give for screen orientation is
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
self.view =[[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
self.view.backgroundcolor =[UIColor redColor];
UIView *subview;
subview = [[UIView alloc] initWithFrame:CGRectMake(0,0,320,480)];
subview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@""]];
subview.autoresizingMask = UIViewAutoResizingFlexibleWidth |UIViewAutoresizingFlexibleHeight;
Problem:
When i turn into Landscape the subview is resized with the image, but the buttons remain in the same position and i am not using any .xib file.I have created the project programmatically.Please do reply....