How do I create a ListView like the YouTube App? [closed]

China☆狼群 提交于 2019-12-14 03:37:53

问题


I've been working on an Android Application, and one of the major issues i've been trying to deal with is customization of a ListView or GridView.

Does anybody know how to make my app with a ListView or GridView to look very much like this?


回答1:


The most important thing to apply this kind of design is properly implement adapter, which will represent every piece of data (one video in your situation).

More or less in for situation it will look like:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

//you main picture
  <ImageView
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">

  //layout to place other info like number of likes, comments, author etc.
      <RelativeLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center">

   //number of likes
          <TextView ... >

   //number of comments
          <TextView ... >

    ...

      </RelativeLayout>

  </RelativeLayout>

Set those views in positions, which suit you.



来源:https://stackoverflow.com/questions/25042655/how-do-i-create-a-listview-like-the-youtube-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!