gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 16:20:09 25 4
gpt4 key购买 nike

我正在使用 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com