本文介绍了Android版Gmail应用程式,例如列表视图,在图标上的字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找像Gmail的Andr​​oid应用程序的电子邮件列表中选择一个解决方案,我想与滑动删除,并有标题和标题的第一个字符的图标列表。在我的应用程序,这将被用来从一个数据库表中的应用表现出一定的名字,所以会有像在名称的第一个字母,然后在它旁边的名称Gmail应用此图标。刷卡会给一个选项删除。

I am looking for a solution like the emails list in gmail's android app, I want a list with swipe to delete and to have title and an icon with the first character of the title. in my application this will be used to show some names in the app from a database table, so there will be this icon like in the gmail app with the first letter of name and then the name next to it. Swiping will give an option to delete.

下面是供参考的截图(我将只用标题,左和时间的图标!)

here is the screenshot for reference (I would be using just the title ,the icon on left and time ! )

更新

现在我打算使用为EUGEN建议。现在我有这个问题,在库的样本文件夹提供的样品适配器,使用listarry为数据集

Now I am planning to use TextDrawable as EUGEN advised. Now I have this issue, The Sample adapter provided in sample folder of the library, uses listarry as dataset

private List<ListData> mDataList = Arrays.asList(
        new ListData("Iron Man"),
        new ListData("Captain America"),
        new ListData("James Bond"),
        new ListData("Harry Potter"),
        new ListData("Sherlock Holmes"),
        new ListData("Black Widow"),
        new ListData("Hawk Eye"),
        new ListData("Iron Man"),
        new ListData("Guava"),
        new ListData("Tomato"),
        new ListData("Pineapple"),
        new ListData("Strawberry"),
        new ListData("Watermelon"),
        new ListData("Pears"),
        new ListData("Kiwi"),
        new ListData("Plums")
);

我在字符串数组的形式使用数据。我是新来列出阵列和适配器,所以我需要帮助!

I have to use data in the form of string array. I am new to list arrays and adapters so I need help!

推荐答案

我使用。问题是这样的:当你有用户的照片,你显示照片,否则信。所以它更容易只能有一个的ImageView ,而不是在它的顶部有一个额外的的TextView

I use the TextDrawable library. The point is this: when you have the user's photo, you display the photo, otherwise the letter. So it's easier to only have one ImageView instead of having an extra TextView on top of it.

这篇关于Android版Gmail应用程式,例如列表视图,在图标上的字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 14:45
查看更多