I try to implement following behavior of my app:
I've got list of views and show them in scrollview partly.
If user scroll and reaches bottom of scrollview, I add one more view below last view;
If user scroll up and reaches top of scrollview, I add view above the first view.
My problem is that when I add view above the first view it shift all views in layout down.
My question is: how to add view above view in hidden area, so user could have a look by scrolling up?
Related
In a app we have a activity which displays a list of textview let us take a list of numbers 1-9 or more than that.Which view is useful to display textviews either scroll view or Recycler view?
Recyclerview itself has scrollbar implemented in it. It is used when you have a large dataset.
ScrollView is used when you have a limited set of children on your UI and they are fitted out of your screen, so ScrollView is implemented here to scroll your layout to see all the children.
i have a fragment which has a stationary Image View at the top , some linear layouts to display the texts and List View at the Bottom. i want the entire screen to go up(that stationary Image View and middle part) when i scroll down in the List View.
I tried to place all layouts in a single Linear Layout and put it inside Scroll View since it has only one direct child..but that makes only the List view scroll able.
Try using CoordinatorLayout and scrolling behaviour from the design library.You can find a great tutorial here
I'm using horizontal scroll view in my app. I have right arrow icon in the right corner of the scrollview. I need to make that arrow visible only when the scroll view has more childs to scroll.
Suppose if the scroll view has only one child and it doesn't need to scroll, i need to disable the arrow.
Please help me in this.
If current position is the last position in your view just invisible the arrow view
I want to add footer view to GridView in android as we can add to ListView. Since it is not available in Grid View, I added a loading layout at bottom of screen, and a grid view above it. Loading layout becomes visible when we scroll grid view till end. But when loading layout becomes visible, on scrolling upwards, it remains visible. How this can be customized in a way similar to footer of list view. Any help will be highy appreciated.
Grid View doesnot have footer similar to listview. Its workaround used was: Add a view having progress dialog at bottom of screen below gridview and manage its visibility.
In my activity I have a scroll view which contains a linear layout that has many views. Is there a way I can display a specific view (from the linear layout) when starting this activity? By default this view is hidden, so I must scroll the scroll view to make it visible.
Scroll the view to the view you want to show:
scrollView.smoothScrollTo(0, specificView.getTop())
See Is there a way to programmatically scroll a scroll view to a specific edit text?
You can use:
setVisibility(View.GONE);
see setVisibility for details