我看到子视图底部有一个间隙

发布于 2024-09-24 07:52:26 字数 202 浏览 0 评论 0原文

基本上第二个视图应该距离顶部 20px

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

屏幕截图链接

有什么方法可以设置边距或边界,以便视图可以向下 20px

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

Link to screen shot

Is there some way I can set margins or boundaries so the view can go 20px down

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

莫多说 2024-10-01 07:52:26

所以修复方法是

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

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;
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文