How to create Vertical Carousel in android?

安稳与你 提交于 2019-11-29 07:15:53

问题


I want to implement vertical carousel in android.I have searched lot of things about it,Finally i found that horizontal carousel example here. Can any body know that how to convert this horizontal carousel into vertical carousel.

And also i have tried this .Link .This 3d listview gives rotation of the each element but i want to implement whole list should be in 3d. Can any body give suggestions please...


回答1:


If you want a vertical pager, try that library written by Jake Warthon. It's perfectly coded and completely up to date with Android SDK.

The best way to work with 3d is to work with renderscript. I won't be really helpful on that topic.




回答2:


This following code is used to display the carousel in vertical view. I just modified code in this url. http://www.codeproject.com/Articles/146145/Android-3D-Carousel .This is works fine for nexus-landscpape. And also i used this LINK to get view as vertical.

private void Calculate3DPosition(CarouselItem child, int diameter,
            float angleOffset) {
        angleOffset = angleOffset * (float) (Math.PI / 180.0f);
        float y = (float) (diameter / 2 * Math.sin(angleOffset)) + diameter / 2
                - child.getWidth() / 2;
        float z = diameter / 2 * (1.0f - (float) Math.cos(angleOffset));
        float x = (float) (-   diameter / 2 * Math.cos(angleOffset) * 0.5);
        child.setX(x + 250);
        child.setZ(z);
        child.setY(y - 150);
    }


来源:https://stackoverflow.com/questions/9206586/how-to-create-vertical-carousel-in-android

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