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

网站添加站长统计代码营销管理系统

网站添加站长统计代码,营销管理系统,中国建设人才网站,国家网站标题颜色搭配主要实现的那种光晕效果#xff1a;中间亮#xff0c;四周逐渐变淡的。 这边有三种发光效果#xff0c;先上效果图。 第一种、圆形发光体 实现代码#xff1a;新建shape_light.xml#xff0c;导入以下代码。使用时#xff0c;直接给view设置为background。 ?xml …主要实现的那种光晕效果中间亮四周逐渐变淡的。 这边有三种发光效果先上效果图。 第一种、圆形发光体 实现代码新建shape_light.xml导入以下代码。使用时直接给view设置为background。 ?xml version1.0 encodingutf-8? shape xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:shapeovalgradientandroid:centerColorcolor/transparentandroid:centerX0.5android:centerY0.5android:gradientRadius180dpandroid:startColorcolor/yellowandroid:typeradial / /shape 第二种、矩形发光体 代码实现通过自定义view实现。 package com.fht.testprojectimport android.annotation.SuppressLint import android.content.Context import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint import android.graphics.RectF import android.util.AttributeSet import android.view.View/*** author fenghaitao* time 2023/11/1 16:40*/ class RectLightView JvmOverloads constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int 0 ) : View(context, attributeSet, defStyleAttr) {private val paint: Paint Paint()private val corner 50fprivate val count 200init {paint.isAntiAlias falsepaint.style Paint.Style.FILLpaint.color Color.YELLOW}SuppressLint(DrawAllocation)override fun onDraw(canvas: Canvas?) {super.onDraw(canvas)val w width / countval h height / countfor (i in 0..count) {paint.alpha (255 / count) * iif (((width - 2 * (w * i)) 0) ((height - 2 * (h * i)) 0)) {val rectF RectF().apply {left (w * i).toFloat()top (h * i).toFloat()right (width - w * i).toFloat()bottom (height - h * i).toFloat()}canvas?.drawRoundRect(rectF, corner, corner, paint)}}} } 第三种、矩形发光体比上一种更透明 这种有点瑕疵中间有一点空白不过稍微修改一下代码也可以去掉这里就不做修改了。 代码实现通过自定义view实现。 package com.fht.testprojectimport android.annotation.SuppressLint import android.content.Context import android.graphics.Canvas import android.graphics.Color import android.graphics.Paint import android.graphics.RectF import android.util.AttributeSet import android.view.View/*** author fenghaitao* time 2023/11/1 16:40*/ class LightView JvmOverloads constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int 0 ) : View(context, attributeSet, defStyleAttr) {private val paint: Paint Paint()private val corner 1fprivate val count 100init {paint.isAntiAlias falsepaint.style Paint.Style.STROKEpaint.color Color.YELLOW}SuppressLint(DrawAllocation)override fun onDraw(canvas: Canvas?) {super.onDraw(canvas)val w width / countval h height / countpaint.strokeWidth w.toFloat()for (i in 0..count) {paint.alpha (255 / count) * iif (((width - 2 * (w * i)) 0) ((height - 2 * (w * i)) 0)) {val rectF RectF().apply {left (w * i).toFloat()top (w * i).toFloat()right (width - w * i).toFloat()bottom (height - w * i).toFloat()}canvas?.drawRect(rectF, paint)}}} }
http://www.hkea.cn/news/14478118/

相关文章:

  • 咨询北京国互网网站建设优化推广seo
  • 广州公司网站centos wordpress 空白
  • 移动端网站如何建设新赣州房产网
  • 百度商桥代码怎么加到网站上免费空间和域名
  • 网站建设虚线的代码增城网站建设
  • 民兵信息化网站建设企业展厅设计公司虎
  • 商丘网站建设推广公司地址wordpress安装卡住了
  • 网站建设常用模板下载dede网站地图栏目如何上传文件
  • 泸州网站制作微信引流获客软件
  • 南通做网站的花云快速申请免费个人网站
  • 做网站前端后端ui什么意思上海市住房和城乡建设厅网站
  • 山东网站空间汕头招聘网官网登录
  • 交互 网站小广告尺寸
  • 自己做网站上传视频广东网站开发公司电话
  • 温州平阳县营销型网站建设自己做的网站如何包装
  • 网站开发一般会使用框架吗怎么制作网站详细教程视频
  • 秦皇岛做网站汉狮网络做美容一般在哪个网站团购比较好
  • 网站开发有什么工作内容做钢材的网站有哪些
  • 广州做网页的公司企业网站优化的原则
  • 公司网站市场价如何做好阿里巴巴企业网站建设
  • 个人网站可以做经营性的吗做网站视频存储在哪里
  • 商务网站建设网站的绝对路径怎么做
  • 西南能矿建设工程公司网站免费的成品网站
  • 贵阳商城网站建设义乌做网站
  • 云主机网站如何备份青海住房城乡建设厅网站
  • 织梦网站tag怎么做wordpress ip黑名单
  • 门户网站开发投标文件企业网站优化策略
  • 怎样拍照产品做网站百度认证官方网站
  • 网站搜索优化方案18岁以上站长统计
  • 全国各地网站开发外包h5动画制作