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

汕头中文建站模板广州网站建设模板

汕头中文建站模板,广州网站建设模板,礼品公司网站源码,免费建筑图纸下载网站Android描边外框stroke边线、rotate旋转、circle圆形图的简洁通用方案#xff0c;基于Glide与ShapeableImageView#xff0c;Kotlin 利用ShapeableImageView专门处理圆形和外框边线的特性#xff0c;通过Glide加载图片装载到ShapeableImageView。注意#xff0c;因为要描边…Android描边外框stroke边线、rotate旋转、circle圆形图的简洁通用方案基于Glide与ShapeableImageViewKotlin 利用ShapeableImageView专门处理圆形和外框边线的特性通过Glide加载图片装载到ShapeableImageView。注意因为要描边在xml定义ShapeableImageView时候padding值与stroke值要保持一直否则圆图会在某些边缘地方被切边。 旋转的话可以在上层Kotlin代码设置rotation动态设置灵活旋转ShapeableImageView也可以在xml里面写死rotation值静态配置不灵活。 ShapeableImageView通过配置shapeAppearance改造成圆形图。 ?xml version1.0 encodingutf-8? LinearLayout xmlns:androidhttp://schemas.android.com/apk/res/androidxmlns:apphttp://schemas.android.com/apk/res-autoandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:orientationverticalcom.google.android.material.imageview.ShapeableImageViewandroid:idid/image1android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:backgrounddrawable/ic_launcher_backgroundandroid:padding30pxandroid:srcdrawable/ic_launcher_foregroundapp:shapeAppearancestyle/rounded_styleapp:strokeColorandroid:color/holo_red_darkapp:strokeWidth30px /com.google.android.material.imageview.ShapeableImageViewandroid:idid/image2android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:backgrounddrawable/ic_launcher_backgroundandroid:padding30pxandroid:srcdrawable/ic_launcher_foregroundapp:shapeAppearancestyle/rounded_styleapp:strokeColorandroid:color/holo_red_darkapp:strokeWidth30px /com.google.android.material.imageview.ShapeableImageViewandroid:idid/image3android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:backgrounddrawable/ic_launcher_backgroundandroid:padding30pxandroid:srcmipmap/pic1app:shapeAppearancestyle/rounded_styleapp:strokeColorandroid:color/holo_red_darkapp:strokeWidth30px /com.google.android.material.imageview.ShapeableImageViewandroid:idid/image4android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:backgrounddrawable/ic_launcher_backgroundandroid:padding30pxandroid:rotation-30android:srcmipmap/pic1app:shapeAppearancestyle/rounded_styleapp:strokeColorandroid:color/holo_red_darkapp:strokeWidth30px /com.google.android.material.imageview.ShapeableImageViewandroid:idid/image5android:layout_widthwrap_contentandroid:layout_heightwrap_contentandroid:layout_gravitycenterandroid:backgrounddrawable/ic_launcher_backgroundandroid:padding30pxandroid:rotation-30android:scaleTypecenterCropandroid:srcmipmap/pic1app:shapeAppearancestyle/rounded_styleapp:strokeColorandroid:color/holo_red_darkapp:strokeWidth30px //LinearLayout styles.xml: ?xml version1.0 encodingutf-8? resources xmlns:xliffurn:oasis:names:tc:xliff:document:1.2style namerounded_styleitem namecornerFamilyrounded/itemitem namecornerSize50%/item/style /resourcesimport 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 findViewByIdShapeableImageView(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 findViewByIdShapeableImageView(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 RoundedBitmapDrawableAndroid官方的圆角图形图象实现方案RoundedBitmapDrawable是Android在support v4的扩展包中新增的实现圆角图形的关键类借助RoundedBitmapDrawable的帮助可以轻松的以Android标准方式实现圆角图形图象。现在结合他人的代码加以修改给出一个以原始图形中心为原点修剪图片为头像的工具类此类可以直接在布局文件中加载使用比。所实现的在Kotlin动态代码中绘制的描边效果。https://blog.csdn.net/zhangphil/article/details/134297059
http://www.dnsts.com.cn/news/175156.html

相关文章:

  • 网站建设前端和后端的区别网站建设经典文章
  • 自己的网站就可以做app衡水电商网站建设
  • 做淘宝的人就跟做网站一样vps lnmp wordpress
  • 嘉兴公司网站模板建站网页设计找什么工作
  • 校园网站建设系统设计红盾工商信息查询网
  • 做国外网站推广电子商务的就业方向是什么
  • 哪些网站推广公司百度商桥怎么接网站
  • 如何查到网站是谁做的给单位做网站需要多少钱
  • 个人网站建设模板wordpress怎么更换系统文件
  • 廊坊电商网站建设望野王绩拼音
  • 贵阳企业建站系统模板WordPress预各式华化
  • 网站设计好网站福田汽车官网报价大全
  • 苍溪规划和建设局网站绍兴网站建设开发
  • 做阿里巴巴类似的网站网站开发制作包括哪些的基本流程
  • php mysql购物网站开发网站开发开发优势
  • 网站建设制作介绍河南如何自己做游戏软件
  • 县级林业网站建设管理建设网站要学什么
  • 为什么用php做网站专业建站公司
  • 手机建网站教程通信工程师
  • 有没有便宜做网站的 我要做个山西建设网站
  • 宁波网站建设caiyiduo做网站的费属于什么费用
  • 网站常识wordpress添加跳转页面模板
  • 阿里云做网站经费佛山做pc端网站
  • 合肥做网站yuanmus平面设计工作好找吗
  • 电商网站策划书广州市国外网站建设平台
  • 网站建设公司公司哪家好网络推广方案包括哪些内容
  • 泰安集团网站建设多少钱农业银行总行门户网站建设
  • 网站关键词优化seo关键词之间最好用逗号百度查询关键词排名工具
  • 网站建设的文字用什么字体较好婚纱摄影网站模版整站源码
  • 汉中做网站的公司电话北京 企业网站开发