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

模仿淘宝网站网站目录访问

模仿淘宝网站,网站目录访问,linux vps wordpress,全球咨询公司最新排名Android开发展开收起功能 文字过长展开收起功能很普通#xff0c;也很需要。 一、思路#xff1a; 自定义控件MoreTextView 二、效果图#xff1a; 三、关键代码#xff1a; public class MoreTextView2 extends LinearLayout {/*** TextView的实际高度*/private int …Android开发展开收起功能 文字过长展开收起功能很普通也很需要。 一、思路 自定义控件MoreTextView 二、效果图 三、关键代码 public class MoreTextView2 extends LinearLayout {/*** TextView的实际高度*/private int textViewHeight;/*** 默认全文的Text*/private static final String EXPANDEDTEXT 全文;/*** 默认收起的text*/private static final String COLLAPSEDTEXT 收起;/*** 全文的text*/private String expandedText;/*** 收起的text*/private String collapsedText;/*** 字体大小*/private int textSize;/*** 字体颜色*/private int textColor;/*** 超过多少行出现全文、收起按钮*/private int trimLines;/*** 显示文本的TextView*/private TextView showTextView;/*** 全文和收起的TextView*/private TextView collapseTextView;/*** 是否是收起状态默认收起*/private boolean collapsed true;private boolean show;public MoreTextView2(Context context, AttributeSet attrs) {super(context, attrs);initView(context, attrs);}public MoreTextView2(Context context, AttributeSet attrs, int defStyleAttr) {super(context, attrs, defStyleAttr);initView(context, attrs);}TargetApi(Build.VERSION_CODES.LOLLIPOP)public MoreTextView2(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {super(context, attrs, defStyleAttr, defStyleRes);initView(context, attrs);}private void initView(Context context, AttributeSet attrs) {showTextView new TextView(context);setOrientation(VERTICAL);TypedArray typedArray context.obtainStyledAttributes(attrs, R.styleable.MoreTextView2);textColor typedArray.getColor(R.styleable.MoreTextView2_textColor, Color.GRAY);textSize typedArray.getDimensionPixelSize(R.styleable.MoreTextView2_textSize, 14);expandedText typedArray.getString(R.styleable.MoreTextView2_expandedText);if (TextUtils.isEmpty(expandedText)) {expandedText EXPANDEDTEXT;}collapsedText typedArray.getString(R.styleable.MoreTextView2_collapsedText);if (TextUtils.isEmpty(collapsedText)) {collapsedText COLLAPSEDTEXT;}trimLines typedArray.getInt(R.styleable.MoreTextView2_trimLines, 0);typedArray.recycle();showTextView.setTextSize(textSize);showTextView.setTextColor(textColor);showTextView.setLineSpacing(3f, 1.2f);//hint(没有自我介绍内容时的默认显示)SpannableString ss new SpannableString(getResources().getString(R.string.formal_tips));//定义hint的值AbsoluteSizeSpan ass new AbsoluteSizeSpan(14, true);//设置字体大小 true表示单位是spss.setSpan(ass, 0, ss.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);showTextView.setHint(new SpannedString(ss));showTextView.setHintTextColor(getResources().getColor(R.color.text_aaa));addView(showTextView);}public void setText(CharSequence text) {showTextView.setText(text);globalLayout();requestLayout();invalidate();sum();}四、项目demo源码结构图 有问题或者需要完整源码的私信我
http://www.w-s-a.com/news/84062/

相关文章:

  • 好的网站有哪些企业微信开发者工具
  • 网站通栏代码老外做的中国汉字网站
  • 东莞公司建站哪个更便宜wordpress宝塔伪静态
  • 六安网站建设价格做网站好吗
  • 中小企业网站建设咨询湖南省邵阳建设局网站
  • 分类网站一天做几条合适南安网络推广
  • 案例学 网页设计与网站建设百度竞价关键词出价技巧
  • 做公司网站要那些资料南雄网站建设
  • 自己做的网站发布到网上视频播放不了网页游戏奥奇传说
  • 网站效果用什么软件做品牌网站建设等高端服务
  • 四川省成华区建设局网站网站专业制作
  • 网站建设如何开票网站后台怎么做超链接
  • 教育网站设计方案建设网站技术公司电话号码
  • 建网站要定制还是第三方系统传奇网站模板psd
  • 免费搭建企业网站什么叫网站定位
  • 网站建设cms程序员培训班
  • 网站seo技术wordpress editor ios
  • 红酒网站设计成立公司需要哪些手续
  • 广州做网站哪个好网站建网站建设网站站网站
  • 如何快速提升网站pr短剧个人主页简介模板
  • 上海网站建设 永灿百度权重3的网站值多少
  • 公司展示网站模板模板工
  • 网站建设收费详情舟山公司做网站
  • 深圳宝安区住房和建设局网站html模板大全
  • 和田哪里有做网站的地方wordpress地址更改
  • 恒通建设集团有限公司网站企业网站百度指数多少算竞争大
  • 雅虎网站收录提交入口如何使用wordpress搭建网站
  • 微商城网站建设怎么样发稿是什么意思
  • dz建站与wordpress群晖做网站服务器速度快吗
  • 做手机网站的公司网站建设 app开发 图片