簡體   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