• 演示效果

StateLayout - 图2     StateLayout - 图4

  • 使用案例
  • 属性表: (StateLayout)

常用方法

  • 显示正文布局:showContent();

  1. showLoading(String message)
  • 显示空内容布局:
  1. showError(OnClickListener clickListener)
  2. showError(String message, OnClickListener clickListener)
  • 显示离线(网络异常)布局:
  • 显示自定义布局:showCustom(final CustomStateOptions options)

  • 设置全局多状态样式的方法:使用UIConfig的setStatefulLayoutConfig(StateLayoutConfig config)方法即可。

  • 演示效果
  • 使用案例
  1. <com.xuexiang.xui.widget.statelayout.MultipleStatusView
  2. android:id="@+id/multiple_status_view"
  3. android:layout_height="match_parent"
  4. app:msv_contentView="@layout/layout_content_view"/>
  • 属性表: (MultipleStatusView)

常用方法

  • 获取当前状态:int getViewStatus()
  • 设置重试点击事件:setOnRetryClickListener(OnClickListener onRetryClickListener)
  • 显示空视图:showEmpty()
  • 显示错误视图:showError()
  • 显示加载中视图:showLoading()
  • 显示无网络视图:showNoNetwork()
  • 显示内容视图:showContent()

【注意】:自定义的状态布局的根布局一定要设有控件的ID,否则可能导致切换异常。

  • 演示效果

StateLayout - 图10StateLayout - 图12

  • 使用案例
  • 属性表: (StatusView)