Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

spire.bt

macrumors newbie
Original poster
Apr 8, 2010
22
0
Basically the second view should go 20px from the top

I see a gap at the bottom of the subview, I can see the bottom of the first view

bugzk.png



Is there some way I can set margins or boundaries so the view can go 20px down
 
How do you add that view ?

Try this :

Code:
thatView.frame = [[UIScreen mainScreen] applicationFrame];

'thatView' is the view you want to display.
 
How do you add that view ?

Try this :

Code:
thatView.frame = [[UIScreen mainScreen] applicationFrame];

'thatView' is the view you want to display.


Here is my code with the animation
Code:
-(void)CallingView2{
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
	
	[self setSettingsViewController:aSettingsView];
	[aSettingsView release];
	
	[UIView beginAnimations:nil context:NULL];
	[UIView setAnimationDuration:1.0];
	//setting the animation
	[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
	[self.window addSubview:[settingsViewController view]];
	[UIView commitAnimations];
}

this is in the app delegate and i call it form the first view with -(IBAction)

Code:
-(IBAction)Calling2{
	
	WebskiAppBetaAppDelegate *mainDelegate = (WebskiAppBetaAppDelegate *)[[UIApplication sharedApplication] delegate];
	[mainDelegate CallingView2];	
	
}
this is the IBAction that calls the view from the delegate
 
You try this :

Code:
settingsViewController.view.frame = [[UIScreen mainScreen] applicationFrame];
 
This comes from not using a navcontroller. If you use a navcontroller with a hidden nav bar these kinds of oddball errors will be taken care of by the navcontroller.
 
Code:
-(void)CallingView2{
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
    
    [self setSettingsViewController:aSettingsView];
    [aSettingsView release];
    
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    //setting the animation
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
    [self.window addSubview:[settingsViewController view]];
[B]    [[settingsViewController view] setBounds:CGRectMake(0, -30, 320, 480)];
[/B]
    [UIView commitAnimations];
}


I have put the code that is bold in the code where I commit my animation and it works, it moves the view as it should but now the problem is that when i rotate to the view i can see when the view is moving down.
Is it possible to set bounds for the view before it is shown so the user cant see when it is moving 30px down every time he go to settings
 
Code:
-(void)CallingView2{
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
    
    [self setSettingsViewController:aSettingsView];
    [aSettingsView release];
    
   [self.window addSubview:[settingsViewController view]];
[B]    [[settingsViewController view] setFrame:CGRectMake(0, -30, 320, 480)];
[/B]

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.0];
    //setting the animation
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
 
    [UIView commitAnimations];
}


got the problem fixed.I've just put the addSubview before the beginAnimation and that was all
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.