抖音开放平台Logo
开发者文档
“/”唤起搜索
控制台
  • JavaScript API
  • API 概览
  • 基础
  • 界面
  • 渲染
  • 数据缓存
  • 文件
  • 位置
  • 设备
  • 网络
  • 媒体
  • Worker
  • 数据分析
  • 支付
  • 广告
  • 开放能力
  • 登录
  • 侧边栏能力
  • 设置
  • 授权
  • 添加到桌面
  • 游戏排行榜
  • 订阅消息
  • 开放数据域
  • 开放数据
  • 开放数据分组
  • 客服消息
  • 直播能力
  • 推荐流直出游戏能力
  • 社交互动能力
  • 公会群能力
  • 意见反馈
  • 游戏站
  • 转发
  • 关注
  • 游戏内关注抖音号
  • 关注头条号
  • tt.createFollowButton
  • FollowButton
  • FollowButton
  • FollowButton.onTap
  • FollowButton.offTap
  • FollowButton.destroy
  • FollowButton.show
  • FollowButton.hide
  • tt.checkFollowState
  • 群聊
  • 收藏
  • C# API
  • 基础库 1.19.0 开始支持本方法,这是一个同步方法。

    显示关注按钮。

    前提条件无
    业务背景无
    使用限制无
    注意事项无
    相关教程无

    语法

    FollowButton.show()

    参数说明

    无

    返回值

    无

    代码示例

    2s 后显示关注按钮。
    const followButton = tt.createFollowButton({ type: "image", image: "images/follow-button.png", style: { left: 20, top: 40, width: 150, height: 40, lineHeight: 40, backgroundColor: "#ff0000", textColor: "#ffffff", textAlign: "center", fontSize: 16, borderRadius: 4, borderWidth: 1, borderColor: "#ff0000", }, }); function onTap(res) { const { buttonId, errCode, errMsg } = res; tt.showModal({ title: "关注", content: `关注按钮id:${buttonId}, errCode: ${errCode}, 详细信息:${errMsg}`, }); } followButton.hide(); setTimeout(() => followButton.show(), 2000);
    ​