我看到子视图底部有一个空白

时间:2010-09-17 12:57:26

标签: iphone uiview interface-builder

基本上第二个视图应该从顶部开始是20px

我看到子视图底部有一个间隙,我可以看到第一个视图的底部

Link to screen shot

我是否可以通过某种方式设置边距或边界,以便视图可以向下移动20px

1 个答案:

答案 0 :(得分:0)

所以修复将是

-(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;
}