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

大同网站建设制作哪家好wordpress 微信分享

大同网站建设制作哪家好,wordpress 微信分享,自助单页网站,微信公众号 手机网站开发Android描边外框stroke边线、rotate旋转、circle圆形图的简洁通用方案,基于Glide与ShapeableImageView,Kotlin 利用ShapeableImageView专门处理圆形和外框边线的特性,通过Glide加载图片装载到ShapeableImageView。注意,因为要描边…

Android描边外框stroke边线、rotate旋转、circle圆形图的简洁通用方案,基于Glide与ShapeableImageView,Kotlin

利用ShapeableImageView专门处理圆形和外框边线的特性,通过Glide加载图片装载到ShapeableImageView。注意,因为要描边,在xml定义ShapeableImageView时候,padding值与stroke值要保持一直,否则,圆图会在某些边缘地方被切边。
旋转的话,可以在上层Kotlin代码设置rotation(动态设置,灵活),旋转ShapeableImageView;也可以在xml里面写死rotation值(静态配置,不灵活)。
ShapeableImageView通过配置shapeAppearance改造成圆形图。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><com.google.android.material.imageview.ShapeableImageViewandroid:id="@+id/image1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:background="@drawable/ic_launcher_background"android:padding="30px"android:src="@drawable/ic_launcher_foreground"app:shapeAppearance="@style/rounded_style"app:strokeColor="@android:color/holo_red_dark"app:strokeWidth="30px" /><com.google.android.material.imageview.ShapeableImageViewandroid:id="@+id/image2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:background="@drawable/ic_launcher_background"android:padding="30px"android:src="@drawable/ic_launcher_foreground"app:shapeAppearance="@style/rounded_style"app:strokeColor="@android:color/holo_red_dark"app:strokeWidth="30px" /><com.google.android.material.imageview.ShapeableImageViewandroid:id="@+id/image3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:background="@drawable/ic_launcher_background"android:padding="30px"android:src="@mipmap/pic1"app:shapeAppearance="@style/rounded_style"app:strokeColor="@android:color/holo_red_dark"app:strokeWidth="30px" /><com.google.android.material.imageview.ShapeableImageViewandroid:id="@+id/image4"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:background="@drawable/ic_launcher_background"android:padding="30px"android:rotation="-30"android:src="@mipmap/pic1"app:shapeAppearance="@style/rounded_style"app:strokeColor="@android:color/holo_red_dark"app:strokeWidth="30px" /><com.google.android.material.imageview.ShapeableImageViewandroid:id="@+id/image5"android:layout_width="wrap_content"android:layout_height="wrap_content"android:layout_gravity="center"android:background="@drawable/ic_launcher_background"android:padding="30px"android:rotation="-30"android:scaleType="centerCrop"android:src="@mipmap/pic1"app:shapeAppearance="@style/rounded_style"app:strokeColor="@android:color/holo_red_dark"app:strokeWidth="30px" /></LinearLayout>

styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"><style name="rounded_style"><item name="cornerFamily">rounded</item><item name="cornerSize">50%</item></style>
</resources>

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.google.android.material.imageview.ShapeableImageViewclass MainActivity : AppCompatActivity() {companion object {const val DEGREE = -60const val SIZE = 500}override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContentView(R.layout.activity_main)val iv1 = findViewById<ShapeableImageView>(R.id.image1)GlideApp.with(this).load(R.mipmap.pic1).transform(CenterCrop()).error(android.R.drawable.stat_notify_error).override(SIZE).into(iv1)val iv2 = findViewById<ShapeableImageView>(R.id.image2)iv2.rotation = DEGREE.toFloat()GlideApp.with(this).load(R.mipmap.pic1).transform(CenterCrop()).error(android.R.drawable.stat_notify_error).override(SIZE).into(iv2)}
}

Android Glide加载transform CenterCrop, CircleCrop ShapeableImageView圆形图并描边,Kotlin-CSDN博客文章浏览阅读446次。Android RoundedBitmapDrawable:Android官方的圆角图形图象实现方案RoundedBitmapDrawable是Android在support v4的扩展包中新增的实现圆角图形的关键类,借助RoundedBitmapDrawable的帮助,可以轻松的以Android标准方式实现圆角图形图象。现在结合他人的代码加以修改,给出一个以原始图形中心为原点,修剪图片为头像的工具类,此类可以直接在布局文件中加载使用,比。所实现的在Kotlin动态代码中绘制的描边效果。https://blog.csdn.net/zhangphil/article/details/134297059

http://www.yayakq.cn/news/489988/

相关文章:

  • 公司网站开发制作公司网络营销工具主要类型有
  • 优惠券网站是怎么做的org域名做商业网站
  • h5网站制作平台wordpress 阿里云 漏洞
  • 如何用dw做网站前端wordpress 镜像
  • 怎样建设一个韩国网站深圳百度公司地址在哪里
  • 企业网站建设开始起步文章网络营销推广公司获客
  • 泉州网页建站模板广东免费网络推广软件
  • 页面简单的网站模板免费下载现在花钱做那个网站好呀
  • 广州网站公司网站规划的步骤
  • 恩施网站建设xiduyun番禺网站开发哪家强
  • 表格如何做网站河北辛集住房和城乡建设厅网站
  • 重庆巫山网站设计公司定制网站开发技术
  • 门店做网站有没有必要下载网站模板的软件
  • 绍兴高兴区建设网站部门网站建设管理报告
  • 网站做的不好淄博网站建设方案
  • 网站ip过万网站技能培训机构
  • 宜昌哪里有专业做网站的影视自助建站
  • 义乌市建设局官方网站郑州住房和城乡建设局网站
  • 访问自己做的网站吗推广网站发布文章
  • 保健品企业网站马鞍山建站
  • 商业门户网站制作aspx php哪个做门户网站好
  • 注册网站流程及费用wordpress 传值
  • 百度竞价网站上海十大装修公司口碑排名
  • 预约挂号php网站ftp急着后台密码忘记了泰州网站关键词优化
  • Wordpress网站收录不高公司网站制作公司倒闭
  • 网站建设客户需求分析调研网站建设年终总结怎么写
  • 外包做网站一般多少钱R shinny网站开发
  • 俄文网站开发翻译发布页全部页面设计
  • 深圳设计网站建设游戏推广合作平台
  • 襄阳品牌网站建设建立的英文found