Some words about me

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas a urna sit amet leo sagittis cursus a at lectus. Donec bibendum facilisis ultricies. Maecenas nec arcu dui, ut lobortis erat. In nec condimentum quam. Vivamus euismod scelerisque ligula vitae fermentum. Nulla dignissim rutrum eleifend.

Donec mi eros, congue ut consectetur eget, pretium vitae orci. Aliquam pharetra ultricies lobortis. Morbi eget nisi lectus. Maecenas felis augue, molestie in vestibulum et, lacinia et leo. Suspendisse potenti. Maecenas eget est augue. Donec tincidunt mollis fermentum.

Contact me?

 
 
 

Donec mi eros, congue ut consectetur eget, pretium vitae orci. Aliquam pharetra ultricies lobortis. Morbi eget nisi lectus. Maecenas felis augue, molestie in vestibulum et, lacinia et leo. Suspendisse potenti. Maecenas eget est augue. Donec tincidunt mollis fermentum.

Send the message
 

Android中实现垂直滑动中水平滑动毫无障碍

      其实这个问题这是屡问不爽。但是每一次都要忘记一样。

开始我以为只是一个焦点问题,所以,我花了大把大把的时间在布局文件里面试焦点,真是经验缺乏呀。原来我搞错了对象,对于listview里面的gridview,在listview和gridview外面写一个scrollview就okay,然后重写器OnMeasure()的方法即可

/**
 * Created by catherine on 15/7/23.
 */
public class NoScrollGridView extends GridView {
    public NoScrollGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    /**
     * 设置不滚动
     */
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);

    }

}

  okay,简便收场!

记住:提高代码质量。

posted @ 2015-08-21 19:00  Catherine_Brain  阅读(1171)  评论(0编辑  收藏  举报