意见反馈
创建打开意见反馈页面的按钮。基础库 1.8.4 版本开始支持。
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| type | string | | 是 | 按钮的类型 |
| style | Object | | 是 | 按钮的样式 |
| text | string | | 否 | 按钮上的文本,仅当 type 为 text 时有效 |
| image | string | | 否 | 按钮的背景图片,仅当 type 为 image 时有效 |
type的合法值
| 值 | 说明 |
| text | 可以设置背景色和文本的按钮 |
| image | 只能设置背景贴图的按钮,背景贴图会直接拉伸到按钮的宽高 |
style的结构
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| left | number | | 是 | 左上角横坐标 |
| top | number | | 是 | 左上角纵坐标 |
| width | number | | 是 | 宽度 |
| height | number | | 是 | 高度 |
| backgroundColor | string | | 是 | 背景颜色 |
| borderColor | string | | 是 | 边框颜色 |
| borderWidth | number | | 是 | 边框宽度 |
| borderRadius | number | | 是 | 边框圆角 |
| color | string | | 是 | 文本的颜色。格式为 6 位 16 进制数。 |
| textAlign | string | | 是 | 文本的水平居中方式 |
| fontSize | number | | 是 | 字号 |
| lineHeight | number | | 是 | 文本的行高 |
style.textAlign 的合法值
| 值 | 说明 |
| left | 居左 |
| center | 居中 |
| right | 居右 |
返回值
示例代码
let button = qq.createFeedbackButton({
type: 'text',
text: '打开意见反馈页面',
style: {
left: 10,
top: 76,
width: 200,
height: 40,
lineHeight: 40,
backgroundColor: '#ff0000',
color: '#ffffff',
textAlign: 'center',
fontSize: 16,
borderRadius: 4
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17