模仿2014 google io寫的一個parallax view

jopen 9年前發布 | 11K 次閱讀 Android開發 移動開發 parallax view

介紹:

模仿2014 google io寫的一個parallax view ,下拉縮放,上滾固定頭部。

運行效果:

./slide.gif

使用說明:

在gradle.build中加入

compile 'me.biubiubiu.googleioview:library:1.0'

在xml中配置

<me.biubiubiu.iolistview.library.GoogleIOView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:parallax_color="#66ccff"
    />

設置背景圖片

    GoogleIOView ioView = (GoogleIOView) findViewById(R.id.io);
    ioView.getImageBackground().setImageResource(R.drawable.go_lang_item);

設置背景顏色

    app:parallax_color="#66ccff"

設置標題內容

    ioView.setTitle("hongbosb");

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

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