Simulate stack view in Android 2 (API 5)?

六月ゝ 毕业季﹏ 提交于 2019-12-22 05:58:34

问题


My App must have a widget that can show cards and user can turn over cards. StackWidget sample (in Android's resources) has a good widget:

But there is a StackView in layout of widget and it is available since API Level 11 and I have to implement my App for API level 5.

Also I saw this widget that works API level 7 and upper, and I guess uses OpenGL ES:

Finally how we can simulate stack view in Android 2 (API 5)? Or how we can implement a widget like second image (above)?


回答1:


It is absolutely impossible to use custom views in widgets because of security. You can only use system ones marked with a @RemoteView annotation.

Those fancy animated scrollable 3D widgets OEMs used to put in their firmwares only work with their custom launchers because they are aware of those custom views and allow them to be inflated. Alternatively, these widgets can as well be a part of said custom launchers.



来源:https://stackoverflow.com/questions/12286506/simulate-stack-view-in-android-2-api-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!