I have seen some modern Android and iOS applications where there will be an Image at the top of the page that covers the entire width of the screen. Beneath it, there will be a
You need to add a header to the listview. You can do it by doing this:
final View header = LayoutInflater.from(getActivity()).inflate(R.layout.myheader, null);
((ListView) getActivity().findViewById(R.id.list)).addHeader(header);
Then you can do the scroll effect by doing this:
((ListView) getActivity().findViewById(R.id.list)).setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (v.getChildCount() > 0 && v.getChildAt(0) != null)
header.setTranslationY(Math.round(-v.getChildAt(0).getTop() * 0.5));
}
});
Here header is the header of the listview