[转]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" ...
随机推荐
- 新机器连接老机器遇到的ERROR
Ansible无法连接老旧机器 报错内容: [root@BI ansible]# ansible -i /etc/ansible/hosts GameServer -m ping 10.10.113. ...
- HTTP/HTTPS原理详解
简介 HTTP(Hypertext Transfer Protocal,超文本传输协议)是WWW(World Wide Web,万维网)数据传输的基础,规定如何传输超文本.HTTP协议存在多个版本:H ...
- strtotime出现时区问题不一致的解决方法
学习源头:https://blog.csdn.net/longjuanfengzc/article/details/80622842 https://segmentfault.com/q/101000 ...
- (转)C# Socket简单例子(服务器与客户端通信)
本文转载自:http://blog.csdn.net/andrew_wx/article/details/6629721 这个例子只是简单实现了如何使用 Socket 类实现面向连接的通信. 注意:此 ...
- python开发模块基础:序列化模块json,pickle,shelve
一,为什么要序列化 # 将原本的字典.列表等内容转换成一个字符串的过程就叫做序列化'''比如,我们在python代码中计算的一个数据需要给另外一段程序使用,那我们怎么给?现在我们能想到的方法就是存在文 ...
- c#编写的基于TCP通信的微风IM 版本3 新年新UI
电商商模 背景:来源,产生运营模式:模式特点,服务对象,业务开展,赢利点,扩 张点,定价策略行业分析:市场分析:DX,企业,政策,经济,文化,技术 网站架构:频道,版块,功能体系 项目推广:地面推广, ...
- js操作window
js操作window 常用属性 window.closed // window是否关闭 window.length // iframe个数 window.name // 获取和设置window的名字 ...
- spring-boot多环境配置文件
spring-boot多环境配置文件 目录 配置 多环境配置文件名称要遵循格式 application-{profile}.yml application.yml spring: profiles: ...
- 航图转换相关sql
--旧库列举所有类型航图 select distinct c.identifier airport_icao,d.sc_code chart_type,s.namefrom special_char ...
- 使用JAVA爬取博客里面的所有文章
主要思路: 1.找到列表页. 2.找到文章页. 3.用一个队列来保存将要爬取的网页,爬取队头的url,如果队列非空,则一直爬取. 4.如果是列表页,则抽取里面所有的文章url进队:如果是文章页,则直接 ...