Hello I am relatively new to android developing. What I am trying to do is create a scroll view where I can scroll through multiples images vertically how do I do that? I tried searching for it but I cannot seem to find a solution for it? should I add multiple image view in a scroll view is that possible? if so how?
please help.
Use GridView for that
GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter.
Take and try this Example
or
Create the RelativeLayout inside the ScrollView and add multiple imageview inside the Realtive layout..
First of all if you want to scroll through multiples images vertically then you can use the List View OR Grid view in Android.Both scrolls Vertically.If you want to achieve it through scroll View you can do that by using layout weights to your images or assigning fix height to your images i.e you need to do extra efforts.So better to use List View. You can use the below link for the demo of list view : -
http://www.mkyong.com/android/android-listview-example/
Related
I have Recyclerview in my layout. I am showing images inside the row Layout of this recyclerview. I am using Gallery widget for now to show the images.
But it is not giving me the desired results. I want to use GridView to show images. I want images to scroll horizontally in this gridview when there are more images than the width of device.
Please suggest me how can I achieve this.
https://guides.codepath.com/android/using-the-recyclerview great tutorial to use with everything. The layout manager would be what you need :)
How can I add Grid View to the ListView.I could able to Implement but the problem is Grid View is not Visible its full height. I want to implement just like the Dropbox Photo CustomView which I have attached below. Please guide me in correct Path.
Thanks,
Chaitanya
Using github.com/TonicArtos/StickyGridHeaders library for placing headers in gridview and refer this article http://www.programering.com/a/MjN0ITMwATU.html where is the demo as what are u expecting.
The thing is that you are not supposed to add a scrollable view into another scrollable view. Both ListView and GridView are scrollable, so that just leads to trouble. I suspect that the Dropbox app does not use a GridView, but multiple LinearLayouts, that's at least what I would do. You just can not use an adapter in that case, but need to add the layouts and elements programmatically.
I want to add lazy loading feature to HorizontalScrollView,
Linearlayout as a child and i am addding to linear layout, I want that when image view is out of focus then in horizontal scroll view that can not load but when its come in visible area it will load images(Kind of lazy loading).
I want that because bitmap attached to the child view can be recycled and create bitmap again when child view is visible but the question is how can I make such custom view. I can not use gallery view because it does not solve my purpose I saw that viewgroup has feature of dispatchingViewVisibility and dispatchOnDraw but not sure how to use that with HorizontalScrollView.?
I just want to load fast images in horizontal scroll view which I am adding pro grammatically and prevent OOM issue.
Any suggestion and help would be appreciated
Thanks in advance.
you can use the ViewPager , or use a horizontalListView as created by others (here ,here, and here for example) .
in the adapter , set an asyncTask to load the info , and if you get to go to a new view that was recycled , cancel the asyncTask it had so that it will start a new one .
try to use ViewPager. Acts like HorizontalScrollView but uses adapter as child views source.
Is it possible to allow a griview to scroll both vertically and horizontally simultaneously in android? Please advise.
It doubt that would be possible. A GridView is based on an ArrayAdapter, having only 1 dimension for the items. How would you arrange them in a view that can be extended both vertically and horizontally?
Of course, if you just want to make it larger than the screen and use hard-coded number of rows/columns, you can put it in another scrollable view.
There are following two solutions and you can use one which fits your requirement.
You can use RecyclerView instead of GridView with a custom layout manager. You can read this code for help. Also, you can read this article on how to create custom layout manager. This article gives an example of how to create two-way scrolling grid layout.
The other solution is to use RecyclerView with horizontal scrolling Grid Layout wrapped inside a scroll view.
<ScrollView>
<RecyclerView />
</ScrollView>
use GridLayoutManager with horizontal scroll for recycler view.
The first solution is efficient in a way that it handles view recycling properly.
Hope this will help.
Can anyone help me to create footer in a grid view for Android? I have a grid view which displays the images in the net below that I'm using a textview to display click here to view more images. My problem is to display the message in the gridview. Please help on regarding this one.
i have tried this in which i fixed on textview in bottom as my footer. while i m displaying list view items.
http://www.techuv.com/layout-with-butoon-and-textview-fixed-in-bottom/
Put it below the GridView. Have the GridView and the "footer" be inside some container (RelativeLayout, LinearLayout, etc.) and position them accordingly.