czy1121 / loadinglayout

简单实用的页面多状态布局(content,loading,empty,error)
Apache License 2.0
754 stars 109 forks source link

布局在XML中使用的话?用ButterKnife就会报错? #10

Closed XiongKe94 closed 7 years ago

XiongKe94 commented 7 years ago

看了源码发现你将布局中子View全部移除掉了?

XiongKe94 commented 7 years ago
LayoutInflater mInflater;
    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        if (getChildCount() == 0) {
            return;
        }
        if (getChildCount() > 1) {
            removeViews(1, getChildCount() - 1);
        }
        View view = getChildAt(0);
        setContentView(view);
        showLoading();
    }

猜测,可能就是这个方法报的错吧?

XiongKe94 commented 7 years ago

看到了 子View必须包裹一层 好麻烦啊!

XiongKe94 commented 7 years ago

真心麻烦 各种不显示 还不如重新封装