简体   繁体   English

Android 2.X中的StackView实现

[英]StackView implementation in Android 2.X

Need to implement a View which contains 5 Images placed in stack order. 需要实现一个View ,其中包含按堆栈顺序放置的5张图像。 When user move finger up or down at this View picture replace each other. 当用户在此“ View图片上上下移动手指时,请相互替换。

This approach looks like StackView in Android 3.0, but standard StackView displays applications and it works from API 11 level and I develop for Eclair. 这种方法看起来像Android 3.0中的StackView ,但是标准的StackView显示应用程序,并且可以在API 11级别上使用,我为Eclair开发。

Would like to know if you know some sources where this kind of view has already implemented for Android 2.X, or may be you'll give me an advice to try another one approach to implement this stylization kind. 想知道您是否知道某些来源已经针对Android 2.X实现了这种视图,或者可能会给我一个建议,以尝试另一种方法来实现这种样式化。

One option may be to pull the StackView source from a recent Android source base and place it in your application. 一种选择是从最近的Android源库中获取StackView源并将其放置在您的应用程序中。 If I were to do this I would certainly change the package name, and in order to maintain forward compatibility I would see if the original class exists on the platform and use that instead. 如果要这样做,我肯定会更改程序包名称,并且为了保持向前兼容性,我将查看平台上是否存在原始类,而改用该类。

If I were to implement what you describe without consideration for having StackView, I would think this could be done easily enough by overriding ImageView and giving my class an array of images to have the source cycle through. 如果我不考虑使用StackView而实现您所描述的内容,那么我认为可以通过重写ImageView并为我的班级提供一系列图像来使源循环通过,这可以很容易地完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM