- 演示效果
- 使用案例
- 属性表: (StateLayout)
常用方法
显示正文布局:showContent();
showLoading(String message)
- 显示空内容布局:
showError(OnClickListener clickListener)
showError(String message, OnClickListener clickListener)
- 显示离线(网络异常)布局:
显示自定义布局:showCustom(final CustomStateOptions options)
设置全局多状态样式的方法:使用
UIConfig
的setStatefulLayoutConfig(StateLayoutConfig config)方法即可。
- 演示效果
- 使用案例
<com.xuexiang.xui.widget.statelayout.MultipleStatusView
android:id="@+id/multiple_status_view"
android:layout_height="match_parent"
app:msv_contentView="@layout/layout_content_view"/>
- 属性表: (MultipleStatusView)
常用方法
- 获取当前状态:int getViewStatus()
- 设置重试点击事件:setOnRetryClickListener(OnClickListener onRetryClickListener)
- 显示空视图:showEmpty()
- 显示错误视图:showError()
- 显示加载中视图:showLoading()
- 显示无网络视图:showNoNetwork()
- 显示内容视图:showContent()
【注意】:自定义的状态布局的根布局一定要设有控件的ID,否则可能导致切换异常。
- 演示效果
- 使用案例
- 属性表: (StatusView)