当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
神经网络与深度学习(TensorFlow)
CutefishOS系统默认自动桌面壁纸
tianchi过往方法
IDEA Gradle 常遇问题(二)(持续更新)
NC61 两数之和
JZ7 重建二叉树
浅谈CQRS模式
企业公众号开通微信支付
分布式系统关注点(8)——99%的人都能看懂的「熔断」以及最佳实践 (转载非原创)
从房产中介到程序员--80后张江男
FFmpeg长时间无响应的解决方法
关于做2D游戏时,Canvas边界显示在Game窗口的问题
蓝桥历届真题-跑步锻炼
用asp.net基于C#编写简单登录注册界面(访问数据库)
Q_04_04 Q#类型模型
RobotFramework 之 Evaluate
openharmony容器组件之Column
救火队员的行为准则
Jetpack Compose——TextField及OutlinedTextField(文本框)的使用
Q_06_05 文件结构








