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

网站建设的外文参考文献建站之星多少钱

网站建设的外文参考文献,建站之星多少钱,wordpress搜索关键词,wordpress显示标题和seo标题最近在做一个使用接口返回的字符串#xff1a;#ff0000 来动态设置drawable背景颜色与动态设置状态选择器selector的需求#xff0c;之前写习惯了shape的xml#xff0c;还是第一次写动态的#xff0c;有点搞笑#xff0c;搞笑的是自己没写过#xff0c;不知道…最近在做一个使用接口返回的字符串#ff0000 来动态设置drawable背景颜色与动态设置状态选择器selector的需求之前写习惯了shape的xml还是第一次写动态的有点搞笑搞笑的是自己没写过不知道会不会写。 1.很简单直接布局代码 RelativeLayoutandroid:idid/ll_titleandroid:layout_widthmatch_parentandroid:layout_marginRight20dpandroid:layout_marginLeft20dpandroid:layout_height50dpapp:contentInsetStart0dpandroid:backgrounddrawable/shape_red_bgtools:ignoreMissingConstraintsTextViewandroid:idid/toolbar_leftandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_centerVerticaltrueandroid:layout_marginLeft10dpandroid:gravitycenterandroid:singleLinetrueandroid:text菜单android:textColorcolor/whiteandroid:textSize16dpandroid:visibilityvisible /TextViewandroid:idid/toolbar_titleandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:singleLinetrueandroid:text居中标题android:layout_centerInParenttrueandroid:textColorandroid:color/whiteandroid:textSize20dpandroid:visibilityvisible /TextViewandroid:idid/toolbar_rightandroid:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravityrightandroid:layout_marginRight10dpandroid:gravitycenterandroid:layout_alignParentRighttrueandroid:layout_centerVerticaltrueandroid:text秘密android:textColorcolor/whiteandroid:textSize16dpandroid:visibilityvisible //RelativeLayout ?xml version1.0 encodingutf-8? shape xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:shaperectangle!-- size android:height417dp android:width834dp/--gradientandroid:gradientRadius417dpandroid:startColorcolor/redandroid:endColorcolor/redandroid:centerX0.5android:centerY1android:typeradial /cornersandroid:bottomLeftRadius0dpandroid:bottomRightRadius0dpandroid:topLeftRadius0dpandroid:topRightRadius0dp / /shape 2.Activity代码如下 //在Activity的初始化中直接复制下面代码 RelativeLayout llTitle findViewById(R.id.ll_title); llTitle.setBackgroundDrawable(getStateListDrawable());llTitle.setOnClickListener(new View.OnClickListener() {Overridepublic void onClick(View v) {}});//在Activity中的方法 public static StateListDrawable getStateListDrawable() {StateListDrawable selector new StateListDrawable();int parseColor Color.parseColor(#FF00FF);Drawable pressDrawable getRoundRectDrawable(20, Color.parseColor(#ff00ff), true, 0);Drawable selectDrawable getRoundRectDrawable(20, Color.parseColor(#00ffff), true, 0);Drawable defaultDrawable getRoundRectDrawable(20, Color.parseColor(#00ffff), true, 0);selector.addState(new int[]{android.R.attr.state_pressed}, pressDrawable);selector.addState(new int[]{android.R.attr.state_selected}, selectDrawable);// 添加一个默认状态, 默认状态必须写在其他状态的最后面, 否则其他状态失效selector.addState(new int[]{}, defaultDrawable);return selector;}public static GradientDrawable getRoundRectDrawable(int radius, int color, boolean isFill, int strokeWidth){//左上、右上、右下、左下的圆角半径float[] radiusList {radius, radius, radius, radius, radius, radius, radius, radius};GradientDrawable drawable new GradientDrawable();drawable.setCornerRadii(radiusList);drawable.setColor(isFill ? color : Color.TRANSPARENT);drawable.setStroke(isFill ? 0 : strokeWidth, color);return drawable;} //补充设置渐变色 public static GradientDrawable getRoundRectDrawable(int radius, int color, boolean isFill, int strokeWidth){//左上、右上、右下、左下的圆角半径float[] radiusList {radius, radius, radius, radius, radius, radius, radius, radius};GradientDrawable drawable new GradientDrawable();//设置渐变色,渐变方向从左上到右下渐变颜色设置GradientDrawable gradientDrawable new GradientDrawable(GradientDrawable.Orientation.TL_BR,new int[]{R.color.blue_0B1152, R.color.blue_4E5988});drawable.setCornerRadii(radiusList);drawable.setColor(isFill ? color : Color.TRANSPARENT);drawable.setStroke(isFill ? 0 : strokeWidth, color);return drawable;} 亲测有效写这篇文章只是想记录一下完整的实现代码。 相关博客推荐 Android状态选择器selector的详细使用汇总 selector的两种设置方式
http://www.sadfv.cn/news/108617/

相关文章:

  • 凡科网站怎么做建站福州企业如何建网站
  • 义乌购物网站建设多少钱郑州seo招聘
  • 海安做网站的公司视频网站的建设预算
  • wordpress做付费内容网站优化名词解释
  • 移动网站的开发流程徐州建设网站价格
  • 网站设计的性能需求便宜的做网站公司
  • 网站开发表格更换动易网站模板的方法
  • 贵阳学校网站建设储煤棚网架公司
  • 北京手机网站开发nginx wordpress优点
  • 国际网站平台邯郸做wap网站找谁
  • 网站导航页面模板蛋花儿wordpress主题
  • 高端建站费用网站数据库建设access
  • 高校网站建设及管理制度网站建设维护百家号
  • 东莞网站建设 硅橡胶网站建设知识文章
  • 看守所加强自身网站建设工作总结计算机哪方面技术吃香
  • 3网站建设做网站建设工资高吗
  • 手机网站免费建设在线网页爬虫工具
  • 石家庄网站建设备案网站建设crm
  • 全县网站建设管理工作会议召开企业网站开发标准
  • 重庆工程网站建设网站集约化建设纪要
  • 绍兴企业建站模板静态网站建设开发
  • 网站开发的进度控制计划表网站托管及维护
  • 如何接做网站编程的生意广州市软件开发有限公司
  • 想在网站里添加超链接怎么做深圳建网站哪家好
  • 建设一个58一样的网站多少钱网站开发所有工具多大
  • 南阳做网站aokuo徐州市贾汪区建设局网站
  • 企业网站设计有名 乐云seo泰安搭建公司
  • 网站建设费属于广宣费吗完全自建网站
  • 公司建站文案给网站公司看的wordpress给图片加特效
  • 网站开发成本有哪些网站策划内容