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

[多端开发] [已解决][WARN] Could not set arguments on text (Reason: Object is ...

[复制链接]
发表于 2021-8-31 16:59:20
本帖最后由 zhaokei 于 2021-9-1 09:14 编辑

[2021-8-31 16:58:8][WARN] Could not set arguments on text (Reason: Object is not an instance of ViewGroup: a) at main1.js : 0

55
帖子
0
勋章
255
Y币
然后安卓就闪退了。
55
帖子
0
勋章
255
Y币
initData(loadMore) {
                        var that = this;
                        var skip = that.dataList ? that.dataList.length : 0;
                        var dataList = [];
                        for (var i = 0; i < 99; i++) {
                                dataList[i] = {
                                        title: '项目' + (i + skip)
                                };
                                // 瀑布流效果
                                // dataList[i].itemHeight = Math.floor(200 + Math.random()*50);
                        }
                        var gridView = document.getElementById('gridView');
                        if (loadMore) {
                                that.dataList = that.dataList.concat(dataList);
                                gridView.insert({
                                        data: dataList
                                });
                        } else {
                                that.dataList = dataList;
                                gridView.load({
                                        data: dataList
                                });
                        }
                },
55
帖子
0
勋章
255
Y币
这段代码注释掉就不闪退了
55
帖子
0
勋章
255
Y币
zhaokei 发表于 2021-8-31 17:00
initData(loadMore) {
                        var that = this;
                        var skip = that.dataList ? that.dataList.length : 0;

经过自己的排查,不是这段js的问题,是标签的问题,两个text不能嵌套在一起。

<text class="cellprice1">协议价 ¥
                                                        <text class="cellprice1-money">32.5</text>
                                                </text>

这样写就导致了安卓闪退。太坑了。
您需要登录后才可以回帖 登录

本版积分规则