Open gaoweiqiao opened 7 years ago
你好!请问具体的使用场景是什么呢?因为如果不通过inflate的方式,就没有列表控件。
public class FixTwinkRefreshLayout extends TwinklingRefreshLayout {
public FixTwinkRefreshLayout(Context context) {
super(context);
init();
}
private void init() {
//修复使用new FixTwinkRefreshLayout(Context context) 没有初始化onFinishInflate里面的内容从而导致Crash
post(new Runnable() {
@Override
public void run() {
onFinishInflate();
}
});
}
}
目前采用这种方式可以解决,但没有在项目中实践,有待测试
initGestureDetector()方法只在解析xml之后调用,而new 出来的调用不着这个方法.