Search Results

Search found 5 results on 1 pages for 'uivew'.

Page 1/1 | 1 

  • How to get rid of gap when I add my custom UIViewController to window?

    - by wgpubs
    I'm getting this gap at the bottom of my window after I add the view of a custom UIViewController. The gap goes away as the view is shifted down after I move to another view and then back. Here is the code in the app delegate: - (void)applicationDidFinishLaunching:(UIApplication *)application { // Override point for customization after application launch CustomViewController *gvc = [[CustomViewController alloc] init]; self.customViewController = gvc; [gvc release]; [window addSubview:customViewController.view]; [window makeKeyAndVisible]; } "CustomViewController" is used as a root view controller to simply coordinate which other UIViewControllers to display. As such I simply set its view = to that of the first ViewController's view needed like so: - (void)loadView { UIView *v = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; self.view = v; [v release]; // Add the HomeViewController to the top of the stack MainViewController *mvc = [[MainViewController alloc] initWithNibName:@"MainView" bundle:nil]; mvc.delegate = self; self.mainViewController = mvc; [mvc release]; [self.view addSubview:self.mainViewController.view]; } I've tried a bunch of things including what you see here with no luck. Any ideas? thanks

    Read the article

  • Control ( UIButton, UILable) Hides when the Video plays Again on iPhone!

    - by Taimur Hamza
    Hi, I have displayed UIButton on top of Playing Movie using this code. NSArray *windows = [[UIApplication sharedApplication] windows]; if ([windows count] 1) { // Locate the movie player window UIWindow *moviePlayerWindow = [[UIApplication sharedApplication] keyWindow]; // Add our overlay view to the movie player's subviews so it is // displayed above it. [moviePlayerWindow addSubview:self.myABC]; } There are 2 buttons on top of my movie layer. They play different videos.Now the strange part is the video plays fine with buttons showing on top of it. When i press the button to play the other movie plays but the buttons doesnt show. Seems the view reloads and flushes all the Subviews. But i have checked it in the debug mode and it enters into the 'if' condition and this line runs [moviePlayerWindow addSubview:self.myABC]; But the buttons are not dislpayed. Any ideas wats going wrong ? Thanks, Taimur

    Read the article

  • Problem in Autoresizing subviews in iPhone programmatically

    - by Cathy
    Hi, I have created a UIViewController and a UIView with two UIButtons in it. self.view = [[UIView alloc]initWithFrame:CGRectMake( 0,0,320,480)]; self.view.autoresizesSubviews = YES; self.view.backgroundColor = [UIColor redColor]; UIView *view; view = [[UIVew alloc]initWithFrame:CGRectMake(0,0,320,480)]; view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; UIButton *button1; button.frame = CGRectMake(100,130,120,50); [button addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; [view addSubview:button]; [controller addSubview:view]; -(void)buttonAction:(id)sender { //I have created another view for a purpose [view removeFromSuperview]; UIView *view_obj; **view_obj.backgroundColor = [UIColor greenColor];** view_obj.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleWidth; [self.view addSubview:view_obj]; } Problem: When I change the orientation into landscape the view which has the button is resized but when i click on the button the view with the blueColor is displayed without autoresized. Where i can see half as root view in redColor and half as the subview in greenColor.I have also overrided the ShouldAutoRotate method and done this project programmatically. Please do reply me.

    Read the article

1