你确定么?这样focusView 会为null的

解决方案 »

  1.   

    下面使用focusView的时候,的确是有判断是否为空的,所以程序也能运行。
    但我想不通为什么要这样写,如果它肯定返回null的话。
      

  2.   

    View focusView = null;
    int count = ll.getChildCount();
    if (count < ll.getWeightSum()) // 不知道ll.getWeightSum()是什么意思
        focusView = ll.getChildAt(count + 1);// 如果去掉if判断,则
    View focusView = null;
    int count = ll.getChildCount(); // count = 1
    focusView = ll.getChildAt(count + 1); // foucusView = null
      

  3.   

    getWeightSum到底是用来干什么的?这帖子我标题写错了,其实我是想问getWeightSum函数的功能的。