用UIL显示图像的Pinterest风格

时间:2013-08-15 02:44:23

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

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

我正在使用Universal-Image-Loader来显示我的图像。在下面显示的图像中,我以这种方式显示了我的图像,并带有一些视图。无可否认,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" />

1 个答案:

答案 0 :(得分:1)

嘿使用Staggered GridViewUniversal-Image-Loader here查看我对Pinterest类型视图的实现。

相关问题