Hi I have a listview with 11 elements. sometimes I want the user can scoll upto maximum 9th element and sometimes i want to scroll upto 5th element. So can we set maximum scroll position in listview depending on condition?
Thanks
Sunil
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why not create an
OnTouchListenerand attach it to yourListView. In theonTouchevent, check whether the maximum position has been exceeded, and callscrollToto prevent the scroll from going past the maximum.Alternatively, you could simply modify your
ListAdapterto sometimes only list 9 or 5 elements when you want to limit the scroll.