0

I am creating a page which contains a menu header and a PullToRefreshList.

What i want to do is to hide (scrolling) the menu header when the List is scrolled up but the menu header wont be scrolled down when the list is scrolled down (the menu header is in the original position).

What i am doing is set the page's margin whenever the listview is scrolled (using onScroll).

The application behavior is same as i wanted, but the performance is bad. the scrolling down effect is lagged so badly.

Am I doing the right way? Or, is there any better way to implement that?

Thanks.

skaciw
  • 325
  • 1
  • 3
  • 8
  • 1
    Do not reinvent the wheel. https://github.com/chrisbanes/Android-PullToRefresh Basically you disable scrolling in ListView and apply margin to the parent view – Boris Mocialov Jun 25 '13 at 07:18

1 Answers1

1

In your xml layout file, just enclose the part of the xml that you want to scroll in <ScrollView></ScrollView> tags. eg

<TextView
//android properties />
   <ScrollView
     //scrollview properties >
     <EditText
       //android properties />
    </ScrollView>

The EditText is scrolleble and the textview stationary

Lunchbox
  • 1,538
  • 2
  • 16
  • 42
  • what i want to do is put put a view as a "header" of the listview. the header view will only scroll up and disappear and cant scroll down. – skaciw Jun 25 '13 at 07:30