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

我在显示图像时使用Universal-Image-Loader。在下面显示的图像中,我以这种方式显示了图像,并附带了一些视图。不可否认,在显示大量图像时,UIL库可以极大地处理电话内存。我想知道是否可以像Pinterest一样显示我的图像,但仍使用UIL作为生成器。这种方法可能有什么解决方法?或者也许是另一个只处理显示并与UIL兼容的库。



<?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 here实现的Pinterest类型视图。

10-05 21:01
查看更多