开发者

how to disable gallery view scrolling [closed]

开发者 https://www.devze.com 2023-03-02 01:13 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

hi i want to disable ga开发者_开发百科llery view scrolling when we select particular item in gallery view.\ how do i do that. kindly help me out.


Write your own gallery class that extends Gallery. Override the onFling method with something like this :

public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY){
if (itemIsSelected)
    return true;
else return super.onFling(e1, e2, velocityX, velocityY);
}

set the the itemIsSelected flag in your onItemClickListener.

Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消