AndroidScrollingImageView - 連續重復滾動展示圖像的Android ImageView

一個Android視圖顯示連續重復滾動播放的圖片。這可以被用來創建一個視差動畫效果。

Example

Example

Installation

Step 1. Add the JitPack repository to your build file

repositories { // ... maven { url "https://jitpack.io" }
}

Step 2. Add the dependency in the form

dependencies {
    compile 'com.github.Q42:AndroidScrollingImageView:1.0' }

Usage

In your Android layout file add:

<com.q42.android.scrollingimageview.ScrollingImageView
    android:id="@+id/scrolling_background"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    scrolling_image_view:speed="1dp"
    scrolling_image_view:src="@drawable/scrolling_background" />

Don't forget to add the namespace to your root XLM element

xmlns:scrolling_image_view="http://schemas.android.com/apk/res-auto"

In your Java code, you can start and stop the animation like this:

ScrollingImageView scrollingBackground = (ScrollingImageView) loader.findViewById(R.id.scrolling_background);
scrollingBackground.stop();
scrollingBackground.start();

項目主頁:http://www.baiduhome.net/lib/view/home/1438936943864

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!