簡體   English   中英

可以滑下UITabBarController嗎?

[英]Possible to slide down UITabBarController?

我確定我已經在某個地方看到了此代碼,但是我找不到它...

我希望能夠以編程方式向下滑動UITabBarController…不是在過渡到另一個視圖時而是在同一視圖中。

如果要上下滑動UITabBar ,可以嘗試以下操作:

- (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:^ {
        [self.tabBarController.tabBar setFrame:tabBarFrame];
    }];
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM