ikew0ng / SwipeBackLayout

An Android library that help you to build app with swipe back gesture.
Apache License 2.0
6.13k stars 1.4k forks source link

findViewById 返回的对象不兼容泛型写法 #176

Open anyanmolong opened 5 years ago

anyanmolong commented 5 years ago

findViewById 返回的对象不兼容泛型写法, 26以上项目findViewById没有写强转的就接入这项目就会报错, 然后发现没有兼容API26的泛型findViewById方法

toutoumu commented 5 years ago

几年前发现这个问题, 自己下载源码解决了 @Override public View findViewById(int id) { View v = super.findViewById(id); if (v == null && mHelper != null) return mHelper.findViewById(id); return v; }

@Override public T findViewById(int id) { T v = super.findViewById(id); if (v == null && mHelper != null) return mHelper.findViewById(id); return v; }