문제

I am kinda new to Android. If I want to list items in one column, each item is an image + two text-views below it.

Should I use a list-view or a grid-view?

도움이 되었습니까?

해결책

Unless you have plans to make it multicolumn on bigger screen you should use ListView for tasks like that. Besides, it is very easy to switch to GridView in future should you need that.

You just create your image and two rows of text as a list item, similar to what described in this article.

다른 팁

If a column is then better to use ListView. For more than one column is best GridView. How you want to display an image with two TextViews on each item in the ListView then you need to create a custom layout for the ListView item. This is enough for you.

You should use list view for it.

A list view gets populated with it contents using an adapter. Few adapters come inbuilt with the APIs but for adding an image and two text views, you'll need a custom adapter. Here's a tutorial on Custom ListView by Android Hive

Also, I've made my own adapter in this app, you can refer to it to make your own.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top