问题
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