TextView的内容在改变屏幕方向后丢失屏幕、内容、TextView

2023-09-06 04:00:29 作者:该用户不存在

在观察Android模拟器我的应用程序的行为,我看到的EditText内容是改变屏幕方向(按Ctrl + F11)后pserved $ P $。但是TextView的内容被重置为初始值却不遵守程序设置的最新信息。根据定义这种行为?我能做些什么来保持这种内容是什么?

Observing my application behavior in Android emulator, I see that EditText contents is preserved after changing screen orientation (Ctrl+F11). But TextView contents is reset to its initial value and doesn't keep latest information set by the program. Is this behavior by definition? What can I do to keep this contents?

推荐答案

在你的TextView的Andr​​oid使用该属性:freezesText =真正的

Use this property in your textview android:freezesText="true"