我如何迭代Lazyrow中的地图列表? 我正在尝试将图像从catmodel获取到我的layzcolumn。但是我不知道如何,因为我有一个地图列表 LazyRow( HorizontalArrangement =布置

问题描述 投票:0回答:1

data class DishDetailModel( var title: String? = null, var description: String? = null, var image: String? = null, var time: String? = null, var category: ArrayList<String> = ArrayList(), var integrates: Map<String, CastModel> ) : Serializable

castModel.kt:

data class CastModel( var castName: String? = null, var imageUrl: String? = null ) : Serializable

	

有多个函数。您可能使用错误的,导致此错误:

type不匹配:推断类型为list
>,但预期INT是
android android-jetpack-compose android-jetpack
1个回答
0
投票
lazylistscope(Lazyrow Lambda提供的环境)仅具有将

items

(项目数)作为参数的版本。还有其他
Int

功能,但在其他地方被声明为扩展功能。要使用它们,必须明确进口它们。
当您将光标放置在

items+

Space上时,您会看到可用功能的列表。选择获取列表的一个,并应生成以下导入语句:

items

code现在应该编译良好。
    

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.