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

手机微信可以做网站吗html 做网站案例简单

手机微信可以做网站吗,html 做网站案例简单,教学网页制作,上海搬家公司收费价目表2021主要实现的那种光晕效果&#xff1a;中间亮&#xff0c;四周逐渐变淡的。 这边有三种发光效果&#xff0c;先上效果图。 第一种、圆形发光体 实现代码&#xff1a;新建shape_light.xml&#xff0c;导入以下代码。使用时&#xff0c;直接给view设置为background。 <?xml …

主要实现的那种光晕效果:中间亮,四周逐渐变淡的。

这边有三种发光效果,先上效果图。

第一种、圆形发光体

实现代码:新建shape_light.xml,导入以下代码。使用时,直接给view设置为background。

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><gradientandroid:centerColor="@color/transparent"android:centerX="0.5"android:centerY="0.5"android:gradientRadius="180dp"android:startColor="@color/yellow"android:type="radial" />
</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.yayakq.cn/news/474221/

相关文章:

  • 电影vip网站建设步骤天猫网站企业网站专业性诊断分析
  • 长沙网站制作哪机械设备上海网站建设
  • 绍兴 网站建设 电话短视频推广公司
  • wordpress加速优化服务器seo网站推广经理招聘
  • 做网站没赚到钱微小店网站建设用途
  • 金融行业网站建设公司站长之家ping
  • 杭州网站优化推荐软件开发工具和环境
  • 网站迁移教程网站建设策划方案书
  • seo整站优化价格wordpress响应式cms
  • 外贸出口营销网站网络营销推广是做什么的
  • 织梦音乐网站长沙营销推广
  • 模板网站和定制网站有什么区别做vr效果图的网站
  • 新锐媒体网站建设方案24小时在线观看视频直播
  • 网站页面设计尺寸网络代写
  • 计算机专业设计一个网站途牛旅行网站建设策划书
  • 一般网站图标是用什么做的搜索热门关键词
  • 杭州网站建设公司导航模板网站的弊端
  • 怎样建一个自己的网站服务器网站80端口打不开
  • 做调查问卷权威网站应用商店优化
  • 做婚介网站可行性报告模板网站建设俄语
  • 沈阳营销网站建设设计包装
  • 余姚的网站建设金泉网做网站多少钱
  • wordpress 网站加密插件软件技术 网站建设教程
  • 站长统计软件parallax wordpress
  • 母婴网站设计开发免费做效果图的网站有哪些
  • 在线建网站wordpress高效写文章
  • 网站建设公司专业网站费用报价网站建设是固定资产嘛
  • 个人网站开发与设计摘要pc网站开发使用什么布局好
  • 景点网站怎么做网站设计背景
  • 湛江网站建设低价推荐怎么做美食的网站