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

做水果的有什么网站好wordpress电脑访问不了

做水果的有什么网站好,wordpress电脑访问不了,百度自建站,建设工程公司注册条件基本原理 自定义一个IconTextView类继承自TextView#xff0c;添加iconsrc属性#xff0c;表示图片。 重新onDraw方法#xff0c;将图片绘制到textVIew前面,然后将textView右移。 废话不多说了#xff0c;直接代码就明白。 package com.zb;import android.content.Context;…基本原理 自定义一个IconTextView类继承自TextView添加iconsrc属性表示图片。 重新onDraw方法将图片绘制到textVIew前面,然后将textView右移。 废话不多说了直接代码就明白。 package com.zb;import android.content.Context;import android.graphics.Bitmap;import android.graphics.BitmapFactory;import android.graphics.Canvas;import android.graphics.Rect;import android.graphics.drawable.BitmapDrawable;import android.util.AttributeSet;import android.view.View;import android.widget.TextView;public class IconTextView extends TextView {private final String nameSpacehttp://com.zb.text;//保存图像资源ID的变量 private int resourceId0;private Bitmap bitmap;public IconTextView(Context context, AttributeSet attrs) {super(context, attrs); resourceIdattrs.getAttributeResourceValue(nameSpace, iconSrc, 0);//获取图像资源的值 if(resourceId!0) bitmapBitmapFactory.decodeResource(getResources(), resourceId); } Overrideprotected void onDraw(Canvas canvas) {if(bitmap!null){ Rect srcnew Rect();//原图区域 Rect targetnew Rect();//目标区域 src.left0; src.top0; src.rightbitmap.getWidth(); src.bottombitmap.getHeight();int textHeight(int) getTextSize(); target.left0;//计算图像复制区域的纵坐标 target.top(int) (((getMeasuredHeight()-getTextSize())/2)1); target.bottomtarget.toptextHeight; target.right(int) (textHeight*((float)bitmap.getWidth()/bitmap.getHeight()));//绘制 canvas.drawBitmap(bitmap, src, target, getPaint());//向右移动TextView的的距离 canvas.translate(target.right2,0); }super.onDraw(canvas); }} ?xml version1.0 encodingutf-8?LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/android xmlns:zbhttp://com.zb.text android:layout_widthfill_parent android:layout_heightfill_parent android:orientationvertical com.zb.IconTextViewandroid:idid/iconText1 android:layout_widthfill_parent android:layout_heightwrap_content zb:iconSrcdrawable/small android:text妞给爷笑一个 /com.zb.IconTextViewandroid:idid/iconText1 android:layout_widthfill_parent android:layout_heightwrap_content zb:iconSrcdrawable/small android:textSize30dp android:text妞给爷笑一个 //LinearLayout 代码很简单把。这里需要几个地方namespace xmlns:zbhttp://com.zb.text要和代码里面定义的一样。原文http://blog.csdn.net/hopezhangbo/article/details/7351290#转载于:https://www.cnblogs.com/shanzei/archive/2012/04/06/2434500.html
http://www.zqtcl.cn/news/488542/

相关文章:

  • wordpress文章链接怎么改怎么优化关键词排名优化
  • 专业做包包的网站好产品网站做营销推广
  • 网站刚建好怎么做能让百度收录湖北黄石网站建设
  • 网站建设拾金手指下拉二一wordpress 插件破解
  • 天津做网站外包公司有哪些美橙互联网站
  • 石家庄网站建设蓝点办公室装修工程
  • 申请网站空间就是申请域名建设机械网站咨询
  • 做美食网站有哪些网站怎么做自响应
  • 衡水网站建设维护宝安官网网站建设比较好的
  • 网站建设的审批重庆建设工程信息网30系统
  • 泉州软件开发培训机构怎么做网站内部链接的优化
  • 网站定位是什么中国it外包公司排名
  • 洛阳微信平台网站建设网站成功案例分析
  • 网站建设在淘宝怎么分类深圳软件开发招聘信息
  • .net如何做网站个人网站的制作
  • 网站优化排名推广站长统计官方网站
  • 长沙wap网站建设wordpress 用户 函数
  • 淮安做网站的公司有哪些公司目前上海有几个区
  • 怎么做自动跳转网站建站之星 discuz
  • 网站建设开发合同范本页面设计有哪几种风格
  • 重庆做网站重庆做网站做公司网站建设价格
  • 住房建设部官方网站公示公告国内卖到国外的电商平台
  • 安徽省建设厅网站巅川建设有限公司宁波城乡建设网站
  • 做财务还是网站运营wordpress主题 微博
  • 为什么要用CGI做网站网站建设 自学 电子版 pdf下载
  • 建设网站的规则营销型网站建设jm3q
  • 深圳建网站价格防水堵漏公司做网站效果怎样
  • 网站建设东莞老铁博客外国炫酷网站网址
  • 笔杆子写作网站牡丹江信息网0453免费发布信息
  • 网站建设介绍推广用语解释seo网站推广