FollowButton.offTap
移除指定的按钮点击监听事件。
语法
FollowButton.offTap(callback)
参数说明
将要移除的目标事件
Function callback
代码示例
预期表现:点击关注后没有弹窗提示。
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.onTap(onTap);
followButton.offTap(onTap);
Bug & Tip
暂无。
点击纠错
该文档是否对你的开发有所帮助?
有帮助
没帮助
该文档是否对你的开发有所帮助?
有帮助
没帮助