Skip to content

Latest commit

 

History

History
106 lines (83 loc) · 2.42 KB

tabbar_swan-hideTabBar.md

File metadata and controls

106 lines (83 loc) · 2.42 KB
title header nav sidebar
swan.hideTabBar
develop
api
tabbar_swan-hideTabBar

解释:隐藏 tabBar

方法参数

Object object

object参数说明

属性名 类型 必填 默认值 说明
animation Boolean false 是否需要动画效果。
success Function 接口调用成功的回调函数
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

示例

扫码体验

请使用百度APP扫码

图片示例

代码示例

在开发者工具中预览效果

:::codeTab

<view class="wrap">      
    <button type="primary" bindtap="showTabBar">showTabBar</button>
    <button type="primary" bindtap="hideTabBar">hideTabBar</button>
</view>
Page({
    onLoad() {
        swan.hideTabBar();
    },
    showTabBar() {
        swan.showTabBar({
            animation: true,
            success: function () {
                console.log('showTabBar success');
            },
            fail: function (err) {
                console.log('showTabBar fail', err);
            }
        });
    },
    hideTabBar() {
        swan.hideTabBar({
            animation: true,
            success: function () {
                console.log('hideTabBar success');
            },
            fail: function (err) {
                console.log('hideTabBar fail', err);
            }
        });
    }
});

:::

错误码

Android

错误码 说明
1001 执行失败

iOS

错误码 说明
1001 当前页面不含tabbar