如何实现像Playstore主页中的图像滑块

时间:2017-07-01 10:42:41

标签: java android

我正在尝试制作具有此功能的市场应用。我相信这个功能使用ViewPager,但我不确定如何实现这些功能。任何帮助将不胜感激。

How to acheive this effect?

3 个答案:

答案 0 :(得分:0)

这是我见过的最佳解决方案。 我已经将它用于我的许多应用程序。

必须针对新版本的build / apis

进行优化

http://android-pratap.blogspot.in/2015/12/horizontal-recyclerview-in-vertical.html

答案 1 :(得分:0)

使用此处,RecyclerView with Horizo​​ntal Scroll

    LinearLayoutManager linearLayoutManagerNewlyAded = new LinearLayoutManager(SingletonApp.getInstance().getActivityInstance(), LinearLayoutManager.HORIZONTAL, false);
    recyclerViewNewlyAdded.setLayoutManager(linearLayoutManagerNewlyAded);

答案 2 :(得分:0)

playstore中的水平回收站视图使用支持库中的 LinearSnapHelper linearSnapHelper = new LinearSnapHelper(); linearSnapHelper.attachToRecyclerView(yourRecyclerView); 或类似的东西

/* Set DB Connection. */
$select_last_id = "select max(id) as auto_inc from table name";
$res = mysqli_query($mysqli,$select_last_id);
if(mysqli_num_rows($res)>0){
    $row = mysqli_fetch_array($res);
    $new_increment_id = intval($row['auto_inc'])+1;
}
else{
    $new_increment_id = 1;
}