帖子
帖子
用户
博客
课程
1
帖子
0
勋章
2
Y币
技术支持-F 发表于 2018-3-2 17:24
openFrameGroup 的x,y,w,h的值你alert一下,看看正常不

另外你的FrameGroup 里面只有一个frame,你再加 ...

加了,没有显示出来,我尝试了不加url地址,用背景色来调试,但是一点作用没有,就像frame没有引进来一样,但是我url地址那,写demo下面的index.html又能显示处理index的内容
1
帖子
0
勋章
274
Y币
本帖最后由 tomD 于 2018-4-17 15:36 编辑

                var bMap = api.require('bMap');
                bMap.getLocation({
                    accuracy: '100m',
                    autoStop: true,
                    filter: 1
                }, function(ret, err) {
                        alert(JSON.stringify(ret))
                    if (ret.status==true) {
                        var lon=ret.lon;
                        var lat=ret.lat;
                        
                        bMap.getNameFromCoords({
                                    lon: lon,
                                    lat: lat
                                }, function(ret, err) {
                                        alert(JSON.stringify(ret))
                                    if (ret.status) {
                                       
                                    }
                                });
                    } else {
                        alert(err.code);
                    }
                })
编译后返回false,getlocation可以获取的经纬度,getNameFromCoords返回status:false,android平台
380
帖子
4
勋章
6
Y币
tomD 发表于 2018-4-17 14:54
var bMap = api.require('bMap');
                bMap.getLocation({
                  ...

在百度地图开放平台填写你的包名了吗
1
帖子
0
勋章
274
Y币
技术支持-F 发表于 2018-4-17 15:53
在百度地图开放平台填写你的包名了吗

都填过了,我把之前的key删了,重新申请了个key,现在可以了
8
帖子
0
勋章
34
Y币
function domToPic() {                        var UILoading = api.require('UILoading');
                        var wrapper =document.body;
                        //document.body;
                        var id = 0;
                        UILoading.flower({
                                center : {
                                        x : api.winWidth / 2.0,
                                        y : api.winHeight / 2.0
                                },
                                size : 30,
                                fixed : true
                        }, function(ret) {
                                id = ret.id
                        });
                        var trans = api.require('trans');
                        var w = $api.offset(wrapper).w;
                        var h = $api.offset(wrapper).h;
                        var canvas = document.createElement('canvas');
                        var context = canvas.getContext('2d');
                        var getPixelRatio = function(context) {
                                var backingStore = context.backingStorePixelRatio || context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
                                return (window.devicePixelRatio || 1) / backingStore;
                        };
                        var ratio = getPixelRatio(context);
                        canvas.width = w * ratio;
                        canvas.height = h * ratio;
                        canvas.style.width = w + 'px';
                        canvas.style.height = h + 'px';
                        context.scale(ratio, ratio);
                        html2canvas(wrapper, {
                                canvas : canvas,
                                background : '#fff',
                                allowTaint : true
                        }).then(function(canvas) {
                                var imgData = canvas.toDataURL('image/png');
                                imgData = imgData.replace('data:image/png;base64,', '');
                                trans.saveImage({
                                        base64Str : imgData,
                                        album :true,
                                        imgName : 'sample.png',
                                }, function(ret, err) {
                                        if (ret.status) {
                                                UILoading.closeFlower({
                                                        id : id
                                                });
                                                alert("页面截图已保存到相册!")
                                        } else {
                                                UILoading.closeFlower({
                                                        id : id
                                                });
                                                alert("图片保存失败!")
                                        }
                                });
                        });
                }
https://community.apicloud.com/bbs/thread-51613-1-1.html
我测试了,但是出现错误“Uncaught ReferenceError: Promise is not defined at html2canvas.js:3456”
管理员帮忙一下,非常感谢
1
帖子
0
勋章
7
Y币
WIN10  64位 无法运行apicloud2
380
帖子
4
勋章
6
Y币
飝鱼 发表于 2018-6-19 02:49
WIN10  64位 无法运行apicloud2

能运行了吗?
0
帖子
0
勋章
10
Y币
很好,很好 ,很好
11
帖子
0
勋章
270
Y币
function initNav(navData) {
        // 引用NVNavigationBar 模块
        var NVNavigationBar = api.require('NVNavigationBar');
        var nav = $api.byId('nav');
        var navOffset = $api.offset(nav);
        // console.log(JSON.stringify(navData));
        NVNavigationBar.open({
            rect: {
                x: 0,
                y: navOffset.t,
                w: 'auto',
                h: 45
            },
            styles: {
                orientation: 'horizontal',
                bg: '#red',
                bgAlpha: 1,
                font: {
                    size: 16,
                    sizeSelected: 16,
                    color: '#000',
                    colorSelected: '#FE27B7',
                    alpha: 1
                },
                itemSize: {
                    w: 60,
                    h: 48
                }
            },
            items: [{
                "title": "娱乐",
                "bg": "#fff"
            }, {
                "title": "测试",
                "bg": "#fff"
            }],
            selectedIndex: 0,
            fixedOn: api.frameName,
            fixed: false,
            id: 'first'
        }, function(ret, err) {
            // alert(ret.index);
            console.log(ret.eventType);
            if (ret.index == 'undefined') {

            } else {
                api.setFrameGroupIndex({
                    name: 'mainListFrameGroup',
                    index: ret.index
                });
            }
        });
    }

我用的NVNavigationBar模块,为啥ios的手机显示,安卓的就不显示呢
11
帖子
0
勋章
270
Y币
刚开始用apicloud 求指教  NVNavigationBar模块为啥安卓的不显示,ios可以显示
您需要登录后才可以回帖 登录

本版积分规则