未呈现Nativescript IOS 13 ui listview组件

未呈现Nativescript IOS 13 ui listview组件,nativescript,angular2-nativescript,nativescript-telerik-ui,nativescript-plugin,Nativescript,Angular2 Nativescript,Nativescript Telerik Ui,Nativescript Plugin,大家好,我在IOS13上的listview组件有问题 我试着更新到最新版本,但不起作用 我通过直接在node_模块中修补listview.ios.js修复了它 正如这里的评论所建议的: 这很好,但有什么不同的修补方法吗 例如: 我尝试创建新文件app platform.ios.js 并将缺少的方法直接附加到listview,如: const listview = require('nativescript-ui-listview'); listview.ListViewCell.protot

大家好,我在IOS13上的listview组件有问题 我试着更新到最新版本,但不起作用

我通过直接在node_模块中修补listview.ios.js修复了它 正如这里的评论所建议的:

这很好,但有什么不同的修补方法吗

例如:

我尝试创建新文件app platform.ios.js

并将缺少的方法直接附加到listview,如:

const listview = require('nativescript-ui-listview');

listview.ListViewCell.prototype.systemLayoutSizeFittingSizeWithHorizontalFittingPriorityVerticalFittingPriority = function (targetSize, horizontalFittingPriority, verticalFittingPriority) {
    if (this.view && this.view.itemView && this.view.itemView.parent) {
        var owner = this.view.itemView.parent;
        owner._preparingCell = true;
        var dimensions = owner.layoutCell(this, undefined);
        owner._preparingCell = false;
        return CGSizeMake(view_1.layout.toDeviceIndependentPixels(dimensions.measuredWidth), view_1.layout.toDeviceIndependentPixels(dimensions.measuredHeight));
    }
    return targetSize;
};

但这会使我的应用程序崩溃,我无法在未定义上调用方法://

如果有人仍然需要此方法,请使用此方法在main.js path listview中解决此问题

const application = require('application');


if (application.ios) {
    const view_1 = require("tns-core-modules/ui/core/view");
    const listView = require('nativescript-ui-listview');

    listView.ExtendedListViewCell.prototype.systemLayoutSizeFittingSizeWithHorizontalFittingPriorityVerticalFittingPriority = function (targetSize, horizontalFittingPriority, verticalFittingPriority) {
        if (this.view && this.view.itemView && this.view.itemView.parent) {
            var owner = this.view.itemView.parent;
            owner._preparingCell = true;
            var dimensions = owner.layoutCell(this, undefined);
            owner._preparingCell = false;
            return CGSizeMake(
                view_1.layout.toDeviceIndependentPixels(dimensions.measuredWidth),
                view_1.layout.toDeviceIndependentPixels(dimensions.measuredHeight)
            );
        }
        return targetSize;
    };
}

您确定您的
package.json
引用了
“nativescript ui listview”:“^7.1.0”、
或更高版本吗?是的,它不会呈现项目行,但是我的tns ios在4.0.1上,tns cli在5.4.2您的
tns核心模块的版本是什么?另外,包锁文件中的
nativescript ui-core
版本是什么?如果我直接编辑listview.ios.js,这与版本无关,但如何将这些方法添加到原型中?这与版本有关,因为我想这些特定的代码行在7.x中是固定的。如果使用更高版本的UI包运行较低版本的tns运行时/核心模块,则可能存在兼容性问题。但是,如果你能修补好它,你可以,但你应该知道如何和在哪里。我不确定您在哪里找到了上述代码,但包中没有
ListViewCell
的引用。是一个代码片段,它似乎适用于您的案例,具有旧版本的列表视图。