我如何创建一个像YouTube应用一个ListView? [英] How do I create a ListView like the YouTube App?

查看:201
本文介绍了我如何创建一个像YouTube应用一个ListView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直工作在一个Android应用程序,以及主要的问题我一直在试图处理的是一个ListView GridView的或定制的。

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.

有谁知道如何让我的应用程序有一个ListView或GridView控件看起来非常像这个

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

推荐答案

最重要的应用这种设计是正确实施适配器,它会重新present每一块的数据(在您的情况一个视频)

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.

这篇关于我如何创建一个像YouTube应用一个ListView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆