如何实现在安卓定制的堆栈视图?堆栈、视图、如何实现

2023-09-04 10:29:48 作者:家住魔仙堡

我在网上搜索,但我无法找到一些很好的解释或建议。 基本上,我想实现这个功能。

I have searched the internet but I couldn't find some good explanation or advice. Basically, I want to implement this functionality.

上滑下

on slide down

我用StackView类和所有我得到的是这样的对角线堆栈

I used the StackView class and all I get is this "diagonal" stack

我想的观点是一个在后面的另一个,如上述的图片。

I want views to be one behind another, as in the pictures above.

类似的问题是问在这里 - > Android的定制stackview 的,但我无法找到任何令人满意答案。

Similar question is asked here -> Android customize stackview, but I couldn't find any satisfying answers.

我已经阅读了$ C $下StackView的建议,但说实话,我不知道我将如何自定义它来获得我想要的。 当我改变PERSPECTIVE_SHIFT_FACTOR_X的价值或 PERSPECTIVE_SHIFT_FACTOR_Y没有什么变化,我也得到了同样的立体图。我失去了一些东西?

I have read the code for StackView as suggested, but honestly, I don't know how would I customize it to get what I want. When I change the value of PERSPECTIVE_SHIFT_FACTOR_X or PERSPECTIVE_SHIFT_FACTOR_Y nothing changes and I get the same "diagonal view". Am I missing something?

在此先感谢您的答案。

推荐答案

随意这里用我的库中提供。

Feel free to use my library available here.

这不正是你想要的,是根据 ViewPager ,所以你可以使用它只是一个典型的 PagerAdapter 您的选择。

It does exactly what you want and is based on the ViewPager so you can use it with just a typical PagerAdapter of your choice.

 
精彩推荐
图片推荐