Android scrollview with list of items - android

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.

Related

Stick header of listview below any view android

Here I am attaching one image displaying what i want to achieve.
Now, what i want to do is, when the scrollview scrolls upwards, its should scroll the "somedata" "header" and "listview" part behind the image. I have already achieve this.
Next thing should be done is when "header" comes exactly below the "Imageview" while scrolling, it should stick there and then we must be able to scroll the other items of listview.
Can anyone help me ?
First of all, you can not use ListView inside ScrollView.
You can combine your "Some data" and "header" into single layout and set whole layout as your listview HeaderView.This will make your list scrollable with header.

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/

Custom listview in Android with an image at top

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

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