当前位置:网站首页>Jetpack Compose——remember、mutableStateOf、rememberSaveable
Jetpack Compose——remember、mutableStateOf、rememberSaveable
2022-08-09 13:12:00 【lplj717】
1,mutableStateOf:标识这个data是有状态的,如果状态发生了改变,所有引用这个状态的View都需要重新绘制
2,remember:存储值,当界面重新绘制,会读取之前的值,相当于在mutableStateOf 之上又增加了一层内容:把这个变量的值存储脱离函数,即这个函数再次执行这个值并不会变成初始值,但如果页面切换,会失效
3,rememberSaveable:在remember 上保证了可以在页面切换的过程中保存数据
rememberSaveable== remeber + onSaveInstanceState+ onCreate中的read savedInstanceState
当configChanges的时候,将remember的值写入到bundle中,然后重新构建Activity的时候,从bundle读数据
边栏推荐
- GIN Bind mode to get parameters and form validation
- 自己做了个nodejs+epxress+mysql的小项目,怎么才能让别人通过互联网访问呢?
- RobotFramework 之 用户关键字
- Professor Chen Qiang's "Machine Learning and R Application" course Chapter 15 Homework
- Rmarkdown Tutorial
- offset、client、scroll、window.pageYOffset比较
- 海康设备获取YV12图像-不用rtsp
- tkiner组件之滚动文本框(scrolledtext )相关操作
- LeetCode 37. Solve Sudoku
- eslint语法规则报错
猜你喜欢
随机推荐
GET POST PUT DELETE request in GIN
tensorflow图片编码处理基础
一篇ngork直接使用
Professor Chen Qiang the machine learning and R application course chapter 18 assignments
FFmpeg multimedia file processing (FFMPEG logging system)
render解析
分布式系统关注点(8)——99%的人都能看懂的「熔断」以及最佳实践 (转载非原创)
pytest 与 unittest 的区别
Rmarkdown Tutorial
puzzle(016.5)逻辑电路
Q_04_05 使用Qubits
Time series analysis course lab report
Record the system calls and C library functions used in this project-2
缓存和数据库一致性问题
32位机器和64位机器基本数据类型长度
pyautogui的简单操作(1)
43. The sword refers to Offer 1 ~ 1 the number of occurrences of n integers (recursive, mathematics)
C#使用cersharp
pytest 之 fixture的调用
Spark Sql之union