滚动视图保存的位置时的方向变化 [英] Save the position of scrollview when the orientation changes

查看:117
本文介绍了滚动视图保存的位置时的方向变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些是我的布局:

我需要保存滚动位置的方向改变时。因为如果屏幕上显示的布局从纵向模式中间的名字起的例子,它应该来自同一在风景模式下启动。

I need to save the scrolling position when the orientation changes. for example if the screen shows layout starting from middle name in portrait mode,it should start from same in the landscape mode.

请帮我了。

推荐答案

您如果你的活动不旋转任何改变,你可以使用 机器人:configChanges =定位| keyboardHidden |屏幕尺寸在这个特殊的活动中manifest文件。

You If your activity is not changing anything on rotation you can use android:configChanges="orientation|keyboardHidden|screenSize" in manifest file within this particular activity.

注意:

如果您需要使用景观和肖像不同意见,或者如果您需要使用不同的视图为不同的设备,每个人都应该使用捆绑的onSaveInstanceState和保存数据和检索OnCreate中的数据。此方法停止重新创建活动和活动假定事情会由用户他/她自己来处理。

这篇关于滚动视图保存的位置时的方向变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆