Android開源:ExpandableViewpager - 可以展開縮放的 Viewpager

CorChilders 8年前發布 | 13K 次閱讀 ViewPager Android開發 移動開發

這是很酷一個可以展開,縮小的Viewpager。

使用

在gradle添加依賴

allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }

    dependencies {
            compile 'com.github.githubwing:ExpandableViewpager:1.0.0'
    }

其次將ExpandableViewpager添加到布局。

ExpandViewPager提供了Viewpager常用方法以外。還有幾個額外的方法:

//設置背景布局
 mViewpager.setBackgroundView(int resId);

 //設置最小高度
 mViewpager.setMinHeight(int height);

//設置展開關閉監聽器
mViewpager.setOnStateChangedListener(OnStateChangedListener listener);

//展開以及縮小
mViewpager.expand();
mViewpager.collaps();

License

Copyright 2016 androidwing1992

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

 

 

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