菜鸟教程小白 发表于 2022-12-12 15:32:38

iphone - 可以滑下UITabBarController吗?


                                            <p><p>我确定我在某个地方看到过此代码,但我找不到它...</p>

<p>我希望能够以编程方式向下滑动 UITabBarController...不是在转换到另一个 View 时,而是在同一个 View 中。 </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果您想上下滑动 <code>UITabBar</code>,您可以尝试以下操作:</p>

<pre><code>- (IBAction)showHideTabBar:(id)sender {
    static BOOL isShowing = YES;

    CGRect tabBarFrame = self.tabBarController.tabBar.frame;

    if (isShowing) {
      tabBarFrame.origin.y += tabBarFrame.size.height;
    }
    else {
      tabBarFrame.origin.y -= tabBarFrame.size.height;
    }

    isShowing = !isShowing;

    [UIView animateWithDuration:0.3 animations:^ {
      ;
    }];
}
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于iphone - 可以滑下UITabBarController吗?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/4240061/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/4240061/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: iphone - 可以滑下UITabBarController吗?