android - 使用 ng-template 问题的 ListView 内部的 ScrollView

标签 android ios layout nativescript

我正在使用 ng-template + ListView 来推送图片等动态内容。
ListView 位于 ScrollView 内。
我需要滚动整个页面,避免由 ListView 引起的双滚动。
作为解决方法,我将 isUserInteractionEnabled="false" 放在 ListView 上以锁定内容并防止滚动,但内容就像“剪切”一样,我什至无法再滚动如果有更多图片要显示。

代码:

<ListView [items]="items" isUserInteractionEnabled="false">
            <ng-template let-item="item">
                <GridLayout columns="auto" rows="*, *">
                    <GridLayout row="0" col="0" columns="auto" rows="*">
                        <Image col="0" row="0" stretch="fill" height="240" width="240" [src]="item.imageSquare.url"></Image>
                    </GridLayout>
                    <GridLayout row="1" col="0" columns="auto" rows="*">
                        <Image col="0" row="0" stretch="fill" height="160" width="540" [src]="item.imageRect.url"></Image>
                    </GridLayout>
                </GridLayout>
            </ng-template>
        </ListView>

enter image description here

最佳答案

必须给listview打高分,这样性能才会好

<ListView height="150" [items]="items">

doc

关于android - 使用 ng-template 问题的 ListView 内部的 ScrollView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62410452/

相关文章:

css - 等效于使用 Qt 或 GTK 生成平铺 png 的 CSS 网格模板列

java - SignalR Core Android 客户端,JWT 身份验证返回 NULL

java - 如何在 webView 中向网站添加 CSS(填充)

android - 我正在尝试构建 apk 但我在 react-native 中收到此错误

设备上的 iOS 8 自定义键盘

android - 滚动时具有 Horizo​​ntalScrollview 的 ScrollView 滞后

android从库项目中导入资源

ios - CoreData删除保存错误

ios - 更改所选 UITableViewCell 的背景颜色

c# - 如何在调整窗体大小时移动面板中的所有控件?