Android加载动画库
16lz
2021-01-24
效果图:
使用方法:
Step 1
implementation 'com.wang.avi:library:2.1.3'
Step 2
添加这个Ui到你的布局 androdi:visibility最好设置为“gone”
简单用法:
<com.wang.avi.AVLoadingIndicatorView android:layout_width="wrap_content" android:layout_height="wrap_content" app:indicatorName="BallPulseIndicator" />
高级用法:
<com.wang.avi.AVLoadingIndicatorView android:id="@+id/avi" android:layout_width="wrap_content" //or your custom size android:layout_height="wrap_content" //or your custom size style="@style/AVLoadingIndicatorView"// or AVLoadingIndicatorView.Large or AVLoadingIndicatorView.Small android:visibility="visible" //visible or gone app:indicatorName="BallPulseIndicator"//Indicator Name app:indicatorColor="your color" />
Step 3:
代码中调用:
void startAnim(){ avi.show(); // or avi.smoothToShow(); } void stopAnim(){ avi.hide(); // or avi.smoothToHide(); }
详细见原Github:https://github.com/81813780/AVLoadingIndicatorView
更多相关文章
- 【Android动态布局】之【LayoutInflater的使用】
- android:layout_marginHorizontal="" 无作用
- Android Fragment Demo(适合初学者)
- [置顶] Android 四种基本布局LinearLayout、RelativeLayout、Fra
- android LinearLayout布局
- Android 线性布局 计算器
- 相对布局练习
- 线性布局练习
- android 布局 LinearLayout