【发布时间】:2016-12-01 05:33:49
【问题描述】:
最近我在 Android 中制作自定义视图。
像这样:
the capture of the custom view before rotating
但是当我旋转手机屏幕时,应用程序执行onPauseonStoponDestroy然后执行onCreateonStartonResumeonMeasureonDraw,所以它使从0的视图无效x 坐标。
像这样:
the capture of the custom view after rotating
我想把scroll X的值存储到SharePreferences,但是我真的不知道怎么在自定义视图中管理Activity Lifecycle。
【问题讨论】:
-
我的声望不够,请点击图片链接查看图片。
-
我不确定,水平滚动视图可能对你有帮助。
标签: android android-activity android-custom-view activity-lifecycle