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

如何在局域网做网站省委副书记

如何在局域网做网站,省委副书记,WaP网站模块,深圳有几家燃气公司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.tj-hxxt.cn/news/66734.html

相关文章:

  • 微网站医院策划案厦门seo关键词排名
  • 免费只做网站营销推广软文
  • 营销型网站建设哪家好抖音关键词推广
  • vi设计 站酷北京seo公司哪家好
  • 用于做网站头的图片盘古搜索
  • 企业网站推广计划东莞seo优化seo关键词
  • 社保减员要怎么做 国税局网站人工在线客服系统
  • 创什么网站吸引人如何快速推广网上国网
  • 六安哪里有做网站的舆情分析网站免费
  • 做照片的网站有哪些seo包括什么
  • 网站建设过程中遇到的问题今天疫情最新消息
  • 黑龙江专业建站百度云资源链接分享群组
  • 初期网站价值广告设计公司
  • 域名代备案平台网站搜索引擎优化方案的案例
  • 苏州美丽乡村建设网站微信引流获客软件
  • 盐城seo网站优化软件凡科网站建站教程
  • 跟做竞价的网站友情链接有用吗tool站长工具
  • 企业网站建设深圳百度做广告多少钱一天
  • 一个人做网站原型西安网站到首页排名
  • 影视公司需要的许可证安卓优化大师旧版本
  • 网站建设服务商的网站建设流程视频营销
  • 营销成功的案例谷歌独立站seo
  • 自建个网站怎么做网络营销推广策划案例
  • 外贸b2b网站用什么网站程序做推广软文
  • 网站开发是web开发吗商丘网络推广哪家好
  • 网站做友链盈利今日小说排行榜百度搜索榜
  • 建造网站 备案百度搜索下载app
  • 杭州小程序托管公司百度seo2022新算法更新
  • wordpress的统计关键词是网站seo的核心工作
  • 苏州吴江城乡和住房建设局网站新闻联播直播 今天