帖子
帖子
用户
博客
课程
显示全部楼层
4
帖子
0
勋章
7
Y币

[开发工具] 应用UIChatBox模块,按钮不显示图片样式

[复制链接]
发表于 2017-8-14 15:42:46
引用了官方案列,比如
  btns: [{
            title: '图片',
            normalImg: 'widget://res/img/chatBox_album1.png',
            activeImg: 'widget://res/img/chatBox_album2.png'
        }, {
            title: '拍照',
            normalImg: 'widget://res/img/chatBox_cam1.png',
            activeImg: 'widget://res/img/chatBox_cam2.png'
        }]
图片和拍照没有图片样式,一片空白,上面的路径在studio2中没有,这个必须在线编译下载到手机才能看到吗?不能调试的时候看到吗,或者说可以自定义图片路径?
在引用表情的时候为啥用 widget:// 开头才行,这是什么意思?

var UIChatBox = api.require('UIChatBox');
UIChatBox.open({
    placeholder: '',
    maxRows: 4,
    emotionPath: 'widget://image/emotion',
    texts: {
        recordBtn: {
            normalTitle: '按住说话',
            activeTitle: '松开结束'
        },
        sendBtn: {
            title: '发送'
        }
    },
    styles: {
        inputBar: {
            borderColor: '#d9d9d9',
            bgColor: '#f2f2f2'
        },
        inputBox: {
            borderColor: '#B3B3B3',
            bgColor: '#FFFFFF'
        },
        emotionBtn: {
            normalImg: 'widget://res/img/chatBox_face1.png'
        },
        extrasBtn: {
            normalImg: 'widget://res/img/chatBox_add1.png'
        },
        keyboardBtn: {
            normalImg: 'widget://res/img/chatBox_key1.png'
        },
        speechBtn: {
            normalImg: 'widget://res/img/chatBox_key1.png'
        },
        recordBtn: {
            normalBg: '#c4c4c4',
            activeBg: '#999999',
            color: '#000',
            size: 14
        },
        indicator: {
            target: 'both',
            color: '#c4c4c4',
            activeColor: '#9e9e9e'
        },
        sendBtn: {
            titleColor: '#4cc518',
            bg: '#999999',
            activeBg: '#46a91e',
            titleSize: 14
        }
    },
    extras: {
        titleSize: 10,
        titleColor: '#a3a3a3',
        btns: [{
            title: '图片',
            normalImg: 'widget://res/img/chatBox_album1.png',
            activeImg: 'widget://res/img/chatBox_album2.png'
        }, {
            title: '拍照',
            normalImg: 'widget://res/img/chatBox_cam1.png',
            activeImg: 'widget://res/img/chatBox_cam2.png'
        }]
    }


5
帖子
0
勋章
3759
Y币
'widget://res/img/

在项目的目录下你没有这些图片资源吧
4
帖子
0
勋章
7
Y币
是的,我觉得是这样,然后解决了。
34
帖子
5
勋章
2995
Y币
1.图片资源
2.路径对应
您需要登录后才可以回帖 登录

本版积分规则