[转]android中最好的瀑布流控件PinterestLikeAdapterView
PinterestLikeAdapterView
项目地址:https://github.com/GDG-Korea/PinterestLikeAdapterView
使用方法类似于ListView下面是我使用该控件实现一个显示系统图片的简单应用:
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
>
<com.huewu.pla.lib.MultiColumnListView
xmlns:pla="http://schemas.android.com/apk/res-auto"
android:background="#000000"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
pla:plaColumnNumber="3"
pla:plaLandscapeColumnNumber="3"
>
</com.huewu.pla.lib.MultiColumnListView>
</merge>
plaColumnNumber表示显示多少列,plaLandscapeColumnNumber表示横屏下显示多少列。
但与StaggeredGridView 不同的是他没有提供设置item之间间隙大小的属性,这个可以通过在item的xml中设置一个padding来解决。
另外官方也有demo演示,不过他只是用TextView来实现了Pinterest的交错效果,这相比图片来说要简单的多,因为TextView只需设置不同长度的字符串就能得到不同高度的Item了。
我给的例子只是实现了Pinterest的交错效果,其实瀑布流往往是有上拉加载更多的功能的,这里有一个带有次功能的源码:http://download.csdn.net/detail/xiangxue336/7059861
和http://pan.baidu.com/s/1dDy8OUH
原文地址:http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0919/1696.html
[转]android中最好的瀑布流控件PinterestLikeAdapterView的更多相关文章
- 【转】android中最好的瀑布流控件PinterestLikeAdapterView
[源地址]http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/0919/1696.html 之前我们介绍过一个开源的瀑布流控件Stag ...
- Android 高级UI设计笔记10:瀑布流控件PinterestLikeAdapterView的使用
1. 首先我们看看瀑布流的效果,如下: 2. 今天要介绍的瀑布流控件是:PinterestLikeAdapterView 项目地址:https://github.com/GDG-Korea/Pinte ...
- Android中EditText,Button等控件的设置
EditText可以使用:TextView.setEnabled(true)来设置为可编辑,其实很简单,写在这里以便以后自己查看. Button设置可用性:setVisibility(View.VIS ...
- android中与Adapter相关的控件----ListView
ListView讲解: 一.ListView这个控件是一个使用非常广泛的控件,值得深入的学习和研究.基本使用已经在Adapter中使用过了 二.常用的属性和方法 footerDividersEnabl ...
- android中与Adapter相关的控件----GridView
GridView(网格视图)讲解 一.GridView(网格视图)这个是控件也是比较多,和listView的很多地方都是一样的,但是GridView可以显示多列,而listView只能显示一列,个人觉 ...
- android中与Adapter相关的控件----ViewFlipper
ViewFlipper(翻转视图) 一.ViewFlipper是一个多页面管理的控件,与ViewPager不同,ViewPager的是一页一页的的,而ViewFlipper则是一层一层的.图片轮播或者 ...
- 解决Android中,禁止ScrollView内的控件改变之后自动滚动 - 转
问题: 最近在写一个程序界面,有一个scrollVIew,其中有一段内容是需要在线加载的. 当内容加载完成后,ScrollView中内容的长度会发生改变,这时ScrollView会自动下滚,如下图所示 ...
- android中与Adapter相关的控件----Spinner&AutoCompleteTextView
Spinner(列表选项框) & AutoCompleteTextView(自动完成文本框) 一.列表选项框核心属性 android:dropDownHorizontalOffset设置列表框 ...
- 解决Android中,禁止ScrollView内的控件改变之后自动滚动
<ScrollView android:id="@+id/scrollView1" android:layout_width="fill_parent" ...
随机推荐
- JDK 8 - Lambda Expression 的优点与限制
我们知道 JDK 8 新增了 Lambda Expression 这一特性. JDK 8 为什么要新增这个特性呢? 这个特性给 JDK 8 带来了什么好处? 它可以做什么?不可以做什么? 在这篇文章, ...
- linux composer的使用
安装好的composer使用很简单,分两步加载组件例1.搜索组件:composer search phpexcel2.下载组件:composer require 厂商名/包名然后在使用该插件的脚本中引 ...
- 1118 Birds in Forest
题意: 思路:并查集模板题. 代码: #include <cstdio> #include <algorithm> using namespace std; ; int fat ...
- model进阶(queryset,中介模型,查询优化,extra)
queryset 方法 ############# 可切片 def queryTest(request): ret = models.Atricle.objects.all() 数据库查询 print ...
- Mysql实用知识点总结
本文介绍MYSQL相关知识,方便日常使用查阅 目录 准备 MYSQL常用命令 语言结构 sql语句 外键 自然语言全文搜索 准备 你可以使用 Navicat Premium 12 或者 MySQL W ...
- 用cascade删除有约束的表或记录
删除有约束的表 Drop table TERMPRO_RULE_ROUTE_TYPE cascade constraints:
- leetcode583
public class Solution { public int MinDistance(string word1, string word2) { , word2.Length + ]; ; i ...
- Professional C# 6 and .NET Core 1.0 - Creating Hello, World! with Visual Studio
本文为转载,学习研究 Creating Hello, World! with Visual Studio Chapter 1, “.NET Application Architectures,” ex ...
- inux下安装ab
1,APR 下载地址:http://apr.apache.org/download.cgi 1)tar -zxf apr-1.4.5.tar.gz ./configure --prefix=/u ...
- 使用Layered Window遇到的一些问题及解决方法
1. 使用Layered Window需要设置 WS_EX_LAYERED 属性 2. Layered Window不能作为Child Window 3. 它也不能包含子窗口,为什么呢,因为它收不到 ...