当前位置:网站首页>Jetpack Compose - remember, mutableStateOf, rememberSaveable
Jetpack Compose - remember, mutableStateOf, rememberSaveable
2022-08-09 14:19:00 【lplj717】
1, mutableStateOf: indicates that this data is stateful. If the state changes, all Views that reference this state need to be redrawn
2, remember: store the value, when the interface is redrawn, the previous value will be read, which is equivalent to adding another layer of content on top of mutableStateOf: store the value of this variable out of the function, that is, the value will not become the initial value if the function is executed again, but it will fail if the page is switched
3, rememberSaveable: On remember, it is guaranteed that data can be saved during page switching
rememberSaveable== remeber + onSaveInstanceState+ read savedInstanceState in onCreate
When configChanges,Write the value of remember into the bundle, and then read the data from the bundle when rebuilding the Activity
边栏推荐
猜你喜欢
随机推荐
浅谈CQRS模式
Q_06_02 类型模型
NC193 二叉树的前序遍历
Unity3d_API_Gyroscope 陀螺仪的接口
蓝桥历届真题-蛇形填数
openharmony容器组件之Flex
将 .json 格式 转换成 .xml格式
WPF 系统托盘 图标闪烁
音视频录入的pts和dts问题
NC161 二叉树的中序遍历
32位机器和64位机器基本数据类型长度
oracle财务数据权限思考
openharmony容器组件之Counter
分布式系统关注点(8)——99%的人都能看懂的「熔断」以及最佳实践 (转载非原创)
力扣学习路径
FFmpeg相机花屏花图问题解决方法
NC61 两数之和
Q_04_06 把它放在一起:传送
pytest 之 fixture的定义及作用域
Q_08 更多信息









