Android手写状态切换布局
实现状态切换布局 image 效果图 image 原理 继承RelativeLayout,然后向其中添加各种状态的View,通过对各种View的显示隐藏的切换来实现各种状态的切换。 实现过程 1.继承RelativeLayout,这里通过构造方法之间的调用来简化实例化需要写的代码 public class LoadingLayout extends RelativeLayout { public LoadingLayout(Context context) { this(context,null); } public LoadingLayout(Context context, @Nullable AttributeSet attrs) { this(context, attrs,0); } public LoadingLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } } 2.添加设置状态View的方法,以及盛放...