Basically the second view should go 20px from the top
基本上第二个视图应该从顶部开始20px
I see a gap at the bottom of the subview, I can see the bottom of the first view
我看到子视图底部有一个间隙,我可以看到第一个视图的底部
链接到屏幕截图
Is there some way I can set margins or boundaries so the view can go 20px down
有没有什么方法可以设置边距或边界,以便视图可以降低20px
1 个解决方案
#1
0
so the fix would be
所以解决方案是
-(void)goTo2{
//calling the .xib file and the SettingsViewController
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
[self setSettingsViewController:aSettingsView];
[aSettingsView release];
[self.window addSubview:[settingsViewController view]];
//moving the view 30px down
[[settingsViewController view] setFrame:CGRectMake(0, 20, 320, 460)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
//setting the animation
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[UIView commitAnimations];
[settingsViewController release];
settingsViewController = nil;
}
#1
0
so the fix would be
所以解决方案是
-(void)goTo2{
//calling the .xib file and the SettingsViewController
SettingsViewController *aSettingsView = [[SettingsViewController alloc] initWithNibName:@"Settings" bundle:nil];
[self setSettingsViewController:aSettingsView];
[aSettingsView release];
[self.window addSubview:[settingsViewController view]];
//moving the view 30px down
[[settingsViewController view] setFrame:CGRectMake(0, 20, 320, 460)];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
//setting the animation
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:window cache:YES];
[UIView commitAnimations];
[settingsViewController release];
settingsViewController = nil;
}