美文网首页
Compose by remember 报错问题

Compose by remember 报错问题

作者: xiaoxuan0115 | 来源:发表于2023-10-22 11:42 被阅读0次

在compose中

 var selectedIndex by remember {
            mutableStateOf(0)
    }

IDE报错:Type 'Type Variable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate

解决办法:

需要导入包

import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue

相关文章

网友评论

      本文标题:Compose by remember 报错问题

      本文链接:https://www.haomeiwen.com/subject/nxgridtx.html