Hi everyone, I am trying to create a static title in my ListView related to CustomBaseAdapter.
I want the title to stay on top and not scroll with ListView. Other elements should disappear under the heading if I scroll through the list.
The header is set via the xml file (lvheader) I made. The title is displayed correctly above my ListView, but it is not static and scrolls the ListView.
Can someone please help me with this? thanks in advance
I was already looking for stackoverflow to get some ideas, here is the result.
Add a title to the ListView in my Main.xml:
ListView kp = (ListView)findViewById(R.id.listvw); LayoutInflater inflater = getLayoutInflater(); ViewGroup header = (ViewGroup)inflater.inflate(R.layout.lvheader, kp, false); kp.addHeaderView(header, null, false); ArrayList<SearchResults> searchResults = GetSearchResults(); kp.setAdapter(new MyCustomBaseAdapter(AndroidLogin.this, searchResults, icons)); ... }
source share