java - 使用 UIL 显示图像的 Pinterest 风格

标签 java android android-gridview pinterest universal-image-loader

Pinterest 的图像显示风格非常出色,这会为您的应用增添美感。经过几次研究后,我发现那里有很棒的图书馆可以像 Pinterest 那样显示图像,但不确定这是否与 UIL 兼容。

我正在使用 Universal-Image-Loader 显示我的图像。在下面显示的图像中,我以这种方式显示了我的图像以及一些 View 。不可否认的是,UIL 库在显示大量图像时极大地处理了手机内存。我想知道是否可以像 Pinterest 那样显示我的图像,但仍然使用 UIL 作为生成器。这种方法的可能解决方案是什么?或者可能是另一个仅处理显示的库并与 UIL 兼容。

enter image description here

<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gridview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="center"
    android:horizontalSpacing="4dip"
    android:numColumns="3"
    android:stretchMode="columnWidth"
    android:verticalSpacing="4dip"
    android:padding="4dip" />

更新:

我尝试使用 StaggeredGridView但无法将布局转换为 GridView

 <com.origamilabs.library.views.StaggeredGridView
        xmlns:tools="http://schemas.android.com/tools"
        xmlns:staggered="http://schemas.android.com/apk/res-auto"
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/gridview"
        staggered:numColumns="3"
        staggered:drawSelectorOnTop="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

最佳答案

嘿,看看我使用 Staggered GridViewUniversal-Image-Loader 实现的 Pinterest 类型 View here .

关于java - 使用 UIL 显示图像的 Pinterest 风格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18245531/

相关文章:

java - 如何正确地将文件夹添加到 Eclipse 中的类路径中?

java - Android - 从 UI 线程切换回来?

android - 使用自定义 BaseAdapter 刷新 GridView 内容

android - 图像的 GridView 没有得到刷新

java - 从类内部选择对象并打印

Java DOM : getElementsByTagNameNS for an element in NO namespace

android - 子 Activity 的生命周期

android - Android 应用中的 GridView VS GridLayout

java - 解码正则表达式

java - 更改应用程序背景