- 首页 > it技术 > >
ViewPager与百度地图的滑动冲突
public class ViewPagerCompat extends ViewPager {public ViewPagerCompat(Context context) {
super(context);
}public ViewPagerCompat(Context context, AttributeSet attrs) {
super(context, attrs);
}@Override
protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {
if(v.getClass().getName().equals("com.baidu.mapapi.map.MapView")) {
return true;
}
//if(v instanceof MapView){
//return true;
//}
return super.canScroll(v, checkV, dx, x, y);
}
}
推荐阅读