我知道 RecycleView 和 CardView 的使用,但我想创建可以像 android L Recent App listview 一样工作的 Listview 。
您可以从此链接查看。
下面是 android 5.0 最近应用列表的屏幕截图。
我知道 RecycleView 和 CardView 的使用,但我想创建可以像 android L Recent App listview 一样工作的 Listview 。
您可以从此链接查看。
下面是 android 5.0 最近应用列表的屏幕截图。
您可以使用 carousal 库,例如
http://code.google.com/p/carousel-layout-android/允许创建垂直 carausal。
或者至少你可以从源代码中得到想法。
正如 Mohammad Khatri 所说,您可以使用
http://code.google.com/p/carousel-layout-android/
并将activity_main.xml 更改为
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:background="@android:color/darker_gray">
<!-- <com.touchmenotapps.carousel.simple.HorizontalCarouselLayout
android:id="@+id/carousel_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/> -->
<com.touchmenotapps.carousel.simple.VerticalCarouselLayout
android:id="@+id/carousel_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</RelativeLayout>
要完成以前的答案(因为我无法评论),
为了使http://code.google.com/p/carousel-layout-android/在垂直模式下工作,你需要两件事:
但是,它的工作方式与最近的应用程序显示不完全一样,因为每次滑动都会使您仅移动列表中的一项(没有“甩动”效果)。