I have a minor problem which i can't solve.
I have a layout with scrollview embedding a lot of views.
Everything work fine with the android studio preview in design mode but when i want to access to a view at the bottom, i have to scroll the mouse wheel very long time in order to reach the bottom of the layout. So it works but as soon as i make a change of the view located at the bottom i have to scroll the mouse wheel very very long time so:
Is there a shortcut to go to the bottom of the layout or something else?
Even if i click on the view in the component tree window beside the preview, it selects the view but doesn't displays it.
Thank you.
Hello I am not sure if this would be a duplicate as my wording is probably not the best to describe this on a search. I have a recycler view with a list of strings. Everything works great however, is there a way to make the list scroll a little higher than the bottom of the parent view, in this case keep scrolling up until it hits the middle of the screen? the Recycler view would height is match parent. Thank you in advance!!
Please note: I didnt add code since this is just a regular recycler view nothing special added, let me know if the code is needed as well thank you!
Edit:
this is for a vertical scroll list only. The following images are some list images I got offline but hopefully they can show better what I am trying to accomplish:
I want to be able to scroll the list up to the middle as in the following picture for example:
Expected behavior:
I have got a playerview on top of the screen followed by a stick view below the player view.At the bottom of the screen there is also a listview as shown in the attached image.What i need is,while we scroll the screen up and when the playerview completely vanishes it(Player view) should come to the bottom of the screen as scale animation.Stick view should stay at the top as a header and we should be able to scroll the listview items.When we scrolldown the listview the player view should come on the top as before.
========================================================================
please go through the attached images
My Current implementation:
I have used a listview for creating the User interface and it has been succesfull to a great extend.But am stuck with a doubt.I have implemented the player view as a header of the LISTVIEW.The Stick view is created using the technique ListView-Scroll-Sync which is explained in the below given link https://github.com/gh123man/Partial-Header-ListView-Scroll-Sync).Everything.But the problem am facing is how to move the player view from the top to the bottom of the screen using scale animation.Is it possible to move the listview header to the bottom of the screen.Its somewhat similar to youtube app but not fully.So I cant use the following library (not sure )https://github.com/pedrovgs/DraggablePanel
If there is another way to create this kind of view let me know.please guide me on this.
Try using the following library:
https://github.com/pedrovgs/DraggablePanel
May it help you.
I'm experimenting to see if the layout scheme I want to use is possible. I want to have an XML layout that's scrollable. Within that scrollable layout, I want to have a single line going horizontally across the screen (I used just a View with a fixed height and different color). When that horizontal line reaches the top of the screen, and as I scroll down through the layout, I want it to stop and remain at the top of the screen while being able to scroll through everything below it.
I've been messing around in XML trying to get it to work, basically putting a bunch of junk before it and after it.
Any ideas as to how that might work? Would I have to do something fancy with the java code to fix the red line at the top when the scroll position reaches a certain point? Your help would be greatly appreciated.
I am assuming you want something like Gmail app where when you scroll a mail the header sticks on top... To do this, you need 2 views. You have your regular scroller below and overlay a fixed view on top (you can use a relative layout to do this). When your cell goes past a certain spot, you want to populate and set the visibility of the fixed view to VISIBLE. This would give the impression that the view you want to 'stick' to the top really just got stuck rather than scrolled out of view. You'll have to work out the opposite scrolling scenario too based on the location and height of the scrolled cell/view.
HTH
I am having weird scrolling issues in my pretty simple GridView. Each item in the Grid is simply an ImageView and a TextView. The activity itself is simply an application selector. It looks like a rough version of the basic App Tray in Android.
The issue is that after spending some times scrolling through my view, it will inevitably allow me to continue scrolling past the top row of icons, to a blank screen, and the scroll bar will disappear, leaving me stuck.
It doesn't happen every time I go to the top of the view, only sometimes, and usually only after some excessive scrolling.
If I happen to notice the problem and catch it before the top row disappears off the bottom of the screen, I can usually scroll back through the view and spot some icons missing. There are empty spaces in the grid, and I can only assume that those icons have been moved to some bizarre position, which is allowing the view to scroll past the top.
This is my first Android app beyond a basic Hello World, so it's likely that I've just screwed up something in my layout files. I also realize that this is probably a pretty confusing description, so I'm hoping someone has experienced this and my search abilities simply were unable to find it.
I can post my layout files or other code if someone thinks that's useful.
Oh, and the program is built against 1.5, but is running on 2.2 (whatever state of 2.2 that was that snuck out last week) on my phone. I don't have enough apps to test this on an emulator, but could probably set something up if someone felt it necessary.
Thanks in advance for any help on the issue.
I had same problem, but I post to GridView only ImageView's so pengwang's answer didn't help me. I found explanation for this bug https://code.google.com/p/android/issues/detail?id=16218
The problem is that GridView does not currently handle items with differing heights.
My solution is to use exactly specified layout_height same for all GridView's items.
i have solved it: in the link GridView cannot show image you can try
It seems that if you scroll off the bottom of the GridView and back again very fast a couple of times, you eventually will notice that the elements of the view get shifted one place to the "left" from where they originally were. When this happens, you then can scroll all the way off the top of the GridView. When you do reach the top of the list, item 0 is not displayed, having item 1 in its place and nothing but blackness above that row.
Clicking on any item in this situation resets the list and everything is back to normal.
This must be a bug. It's highly reproducible, and I don't think anything I'm doing is causing the mix up. At this point, adding to the list adapter has stopped.
Right now I'm working with Android 2.3.3.
I just ran into this exact same issue myself -- I have a grid of images that have different heights. After reading the Android developer's doc on GridView, GridView.LayoutParams and GridLayout, I did two things that fix my issue:
find the tallest image in each row, and store the height in a map of row -> rowHeight. Each image that I download has width and height info, so this is easy for me to do by overriding my adapter's addAll(items) method.
in getView(), I create a GridView.LayoutParams(MATCH_PARENT, getRowHeight(position)), which sets each grid item to the max row height for its specific row.
wrap my ImageView inside a LinearLayout. I have tried other layout but LinearLayout is the one that works. Set android:scaleType="fitCenter" and android:adjustViewBounds="true" for the image view.
After above 3 steps I finally got the grid to look right, they have different heights, and there's no scrolling issues.
I had a similar, but probably less common problem, where just scrolling a little bit would scroll the gridview to the end and I was not able to scroll up at all. This only occurred when the gridview was smaller, for example when the keyboard was visible. The problem was that I used:
android:paddingBottom="400dp"
android:clipToPadding="false"
Making padding bottom much smaller fixed my issue. I hope this helps at least someone!