Custom listview in Android with an image at top - android

I have an Android project that displays results, using a simple listview. What I need is to display an image at the top of listview as follows:
Please note, the image on top, should be scrollable. Would you please help me. Thanks.

Use ListView.addHeaderView() to add a header view to the top of your ListView.

List view has header and footer options. You can put your scrollable image view in one XML layout, inflate and use that as list view header.
You can get more info if you search for list view header. The quickest one I can get is
Android listview with header and footer buttons

Related

What is the best way to implement contents and comments in One scroll view

I want to implement the below image in android ,
I have used Relative Layout to display content and Recycler view to display comments but I want both under one scroll while my problem is recycler view is creating another scroll.
I also thought to add a layout dynamically but in that every layout I have to implement click listener for every child , which is not good for performance
What could be the best way to implement it
You can make a ListView where row contains Comments part and add Image as a Header of that ListView.
The other way is to create a Custom Adapter and include Image and Comments as a single row of a ListView
For implementing a click event on each item you can refer to this answer
Why don't you use a ListView with custom elements in it (that look like the comments on the picture) instead of the RecyclerView

Scroll Images in a scrollview Android

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/

Android scrollview with list of items

I want to have a view with the following vertical layout
An image (IamgeView)
A description of the image (TextView)
A list of comments
The constraint is that I want the entire page to scroll and not just the list of comments.
The number of comments may vary. If I use a ListView for the comments the entire screen doesn't scroll.
Please suggest a way to do this.
You can add a header view to your ListView. Whatever you put in the header view will scroll just like the list.

Not scrollable listview in scroll view android

i need to make a layout that is scrollable, holds a listview that is not scrollable(full height of the content). So when i scroll the content above the listview is showed, and the full listview is displayed.
Is this possible in android?
what do you mean by ListView ( not scrollable).. will it have predefined items(count) ?
you can have a <ScrollView></ScrollView> inside of which a normal(linear/relative layout say id insidelayout1)
For single item of your ListView, create a separate xml(say item.xml) and try to inflate item.xml into insideLayout1.
Will that work for you.. or detail out your requirement...
If you want to put list view inside the scroll view than you have to fix the height of list view.
otherwise you can't scroll it properly.

Need help in the creation of footer in grid view

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.

Categories

Resources