最近在做项目,同时用到这两个控件,在viewpager中嵌入了google map,但是发现地图左右滑动出现了卡顿,于是乎推测可能是Viewpager的原因,两者冲突。

解决办法:

重新写一个NewViewPager继承Viewpager

public class NewViewPager extends ViewPager {    public NewViewPager (Context context) {        super(context);    }    public NewViewPager (Context context, AttributeSet attrs) {        super(context, attrs);    }    @Override    protected boolean canScroll(View v, boolean checkV, int dx, int x, int y) {        // Not satisfied with this method of checking...        // working on a more robust solution        if(v.getClass().getName().equals("maps.j.b")) {            return true;        }//if(v instanceof MapView){        //    return true;        //}return super.canScroll(v, checkV, dx, x, y); }}
布局中写:
   
   
   
   


更多相关文章

  1. Android(安卓)获取控件高度宽度三种方法,防止0的出现~~~~赞
  2. android listView 总结
  3. android 控件 单项选择(RadioGroup,RadioButton)
  4. Android(安卓)UI 基本布局 weight 在 LinearLayout 中
  5. Android(安卓)自动化测试―robotium(四)CheckBox控件
  6. 小记 ScrollView 隐藏 里面空间填充后再次设置显示,界面会自动往
  7. android中设置控件边框以及如何保留上或下边框
  8. android ViewPager
  9. 卡片式ViewPager,让你的界面炫酷起来! ! !

随机推荐

  1. IPython6.0发布:放弃支持Python2.7
  2. Django2.0即将带来3个重要特性
  3. 多线程学习(三)那些队列可用于线程池
  4. 用翻译赚钱,翻译社规则调整
  5. Fedora写给Python的情书
  6. 值得关注的5个Python开源项目
  7. 2分钟理清计算机、Python和Pip的三角关系
  8. 用Python制作3D动画
  9. 如果你也用Win10,真的请备份!
  10. 不看教程,可能更浪费你的时间