//第一步 导入依赖
implementation 'com.github.zzz40500:android-shapeLoadingView:1.0.3.2'
//第二步 xml布局
<Button
android:id="@+id/mButton"
android:text="按钮"
android:layout_width="100dp"
android:layout_height="wrap_content" />
<com.mingle.widget.LoadingView
android:id="@+id/loadView"
android:layout_gravity="center_horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
//第三步 Activity里使用:
private void initView() {
mButton = (Button) findViewById(R.id.mButton);
loadView = (LoadingView) findViewById(R.id.loadView);
loadView.setLoadingText("加载中...");
mButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//点击button按钮隐藏
loadView.setVisibility(View.GONE);
}
});
}
//最好改成16的
minSdkVersion 16
//——————————————————————–完——————————————————————————-
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/118330.html