当前位置: 首页 > news >正文

陇南市网站建设_网站建设公司_网站建设_seo优化

百度云分享tp响应式网站开发,微信公众号开发软件,域名买卖交易平台,lovefort表白网站制作最近需要用到微信的标签功能(如下图所示)。该功能可以添加已有标签#xff0c;也可以自定义标签。也可以删除已编辑菜单。研究了一番。发现还是挺有意思的#xff0c;模拟实现相关功能。该功能使用类似FlowLayout的功能。Flowlayout为一个开源软件(https://github.com/ApmeM/…最近需要用到微信的标签功能(如下图所示)。该功能可以添加已有标签也可以自定义标签。也可以删除已编辑菜单。研究了一番。发现还是挺有意思的模拟实现相关功能。该功能使用类似FlowLayout的功能。Flowlayout为一个开源软件(https://github.com/ApmeM/android-flowlayout)功能为自动换行的布局类型import android.content.Context;import android.util.AttributeSet;import android.view.View;import android.view.ViewGroup;/**** author RAW*/public class FlowLayout extends ViewGroup {private final static int PAD_H 2, PAD_V 2; // Space between child views.private int mHeight;public FlowLayout(Context context) {super(context);}public FlowLayout(Context context, AttributeSet attrs) {super(context, attrs);}Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {assert (MeasureSpec.getMode(widthMeasureSpec) ! MeasureSpec.UNSPECIFIED);final int width MeasureSpec.getSize(widthMeasureSpec) - getPaddingLeft() - getPaddingRight();int height MeasureSpec.getSize(heightMeasureSpec) - getPaddingTop() - getPaddingBottom();final int count getChildCount();int xpos getPaddingLeft();int ypos getPaddingTop();int childHeightMeasureSpec;if(MeasureSpec.getMode(heightMeasureSpec) MeasureSpec.AT_MOST)childHeightMeasureSpec MeasureSpec.makeMeasureSpec(height, MeasureSpec.AT_MOST);elsechildHeightMeasureSpec MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);mHeight 0;for(int i 0; i count; i) {final View child getChildAt(i);if(child.getVisibility() ! GONE) {child.measure(MeasureSpec.makeMeasureSpec(width, MeasureSpec.AT_MOST), childHeightMeasureSpec);final int childw child.getMeasuredWidth();mHeight Math.max(mHeight, child.getMeasuredHeight() PAD_V);if(xpos childw width) {xpos getPaddingLeft();ypos mHeight;}xpos childw PAD_H;}}if(MeasureSpec.getMode(heightMeasureSpec) MeasureSpec.UNSPECIFIED) {height ypos mHeight;} else if(MeasureSpec.getMode(heightMeasureSpec) MeasureSpec.AT_MOST) {if(ypos mHeight height) {height ypos mHeight;}}height 5; // Fudge to avoid clipping bottom of last row.setMeasuredDimension(width, height);} // end onMeasure()Overrideprotected void onLayout(boolean changed, int l, int t, int r, int b) {final int width r - l;int xpos getPaddingLeft();int ypos getPaddingTop();for(int i 0; i getChildCount(); i) {final View child getChildAt(i);if(child.getVisibility() ! GONE) {final int childw child.getMeasuredWidth();final int childh child.getMeasuredHeight();if(xpos childw width) {xpos getPaddingLeft();ypos mHeight;}child.layout(xpos, ypos, xpos childw, ypos childh);xpos childw PAD_H;}}} // end onLayout()}以上所述是小编给大家介绍的android模仿微信收藏文件的标签处理功能希望对大家有所帮助如果大家有任何疑问请给我留言小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持
http://www.ihoyoo.com/news/62662.html

相关文章:

  • 网站开发 瀑布结构大闸蟹公司宣传册设计样本
  • 深圳市网站备案wordpress获取分类导航
  • 网站功能策划wordpress收集
  • 学校的网站如何建设东莞工程网站建设
  • 凡科这样的建站网站云南昆州建设工程有限公司网站
  • 阿里云外贸建站非主流在线制作图片
  • 网站编程培训机构排名前十wordpress用那个采集器
  • 网页设计电商网站网站空间大小怎么查看
  • 江干建设局网站有专做高端折扣女装的网站吗
  • 网站开发账务处理室内设计自学软件
  • 长垣网站建设如何让网站收录公司名
  • 重庆商城网站建设公司网站开发界面图标设计
  • 惠安网站建设公司网站建设 部署与发布
  • ppt接单兼职网站黄石做网站公司
  • wordpress盈利博客杭州网站优化
  • 建设网站后如何上线珠海网站制作服务
  • 网站内容维护费用北京怎么做网站
  • 电子商务网站建设维护实训报告主流开发工具有哪些
  • 国内外网站建设2017手机可播放的网站
  • 网站虚拟主机哪个好最良心的网页传奇
  • 友汇网 做公司网站html5 学习网站
  • 专门做面包和蛋糕的网站黄埔企业网站建设
  • 建设企业网站流程国外网站建设的发展
  • 河北云网站建设莱西网站制作联赛与超
  • 长沙市网站开发seo 网站案例
  • 网站设计在营销中的作用瑞诺国际做外贸网站好吗
  • 宝安附近公司做网站建设多少钱网站地区词优化
  • 电子商务网站建设详细策划书哪里有做ppt的网站
  • 建立网站的第一步室内装修设计怎么学
  • 到国外做网站网站是怎么回事哪里有网站开发