繁体   English   中英

我怎样才能实现CoverFlow视图

[英]How can i achieve CoverFlow view

我想用虚线布局实现溢出视图。 目前我正在使用polidea封面流程库URL [gitHub] 使用此库可以在中心绘制图像。

我希望像这样实现精确的UI。

https://github.com/davidschreiber/FancyCoverFlow中给出了一个很好的方法

Android应用中的FancyCoverFlow可以用作

fancyCoverFlow = new FancyCoverFlow(context);
fancyCoverFlow.setMaxRotation(45);
fancyCoverFlow.setUnselectedAlpha(0.3f);
fancyCoverFlow.setUnselectedSaturation(0.0f);
fancyCoverFlow.setUnselectedScale(0.4f);

您还可以从XML中扩展FancyCoverFlow:

<at.technikum.mti.fancycoverflow.FancyCoverFlow
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        fcf:maxRotation="45"
        fcf:unselectedAlpha="0.3"
        fcf:unselectedSaturation="0.0"
        fcf:unselectedScale="0.4" />

请访问

1) https://github.com/deepwinter/android-coverflow

2) https://github.com/i7an/cover-flow-android

3) https://github.com/driventokill/android-coverflow

4) https://github.com/HelgePlaschke/Android-Cover-Flow-Widget

5) https://github.com/missingfeature/android-coverflow

在Android中您可以使用ViewPager和Below代码来覆盖封面流

    fragmentimage.xml

<?xml version="1.0" encoding="utf-8"?>

<com.example.rajeev.viewpagercoverflow.CarouselLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/transparent"
    android:gravity="center"
    android:orientation="vertical">
    <ImageView
        android:id="@+id/pagerImg"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="fitXY"
        android:contentDescription="@string/app_name"
        android:src="@drawable/back" />
    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
</com.example.rajeev.viewpagercoverflow.CarouselLinearLayout>

有关详细信息,请访问https://teachmeandroidhub.blogspot.com/2018/10/android-tutorial-how-to-create-view.html

暂无
暂无

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

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