如何制作具有三个角和阴影的图像视图 [英] how to make image view with three corner and shadow

查看:82
本文介绍了如何制作具有三个角和阴影的图像视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何制作只有三个角的图像我尝试使用框架布局插入图像视图,并使其成为原始图像的资源添加另一个带有src of border的图像视图,该图像具有3个角bu,这是行不通的

解决方案

使用

ShapeableImageView 要求的最低版本为 1.2.0-alpha03 .

How to make an image with only three corners like this I tried using frame layout the insert image view and make it's resource with original image the add another image view with src of border that has 3 corner bu it doesn't work

解决方案

With the Material Components library you can use the MaterialShapeDrawable.

Just use something like:

  <com.google.android.material.imageview.ShapeableImageView
      app:shapeAppearanceOverlay="@style/onlyonecorner"
      app:srcCompat="@drawable/xxx"
      ../>

with:

  <style name="onlyonecorner">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSize">50%</item>
    <item name="cornerSizeTopRight">0dp</item>
  </style>

The ShapeableImageView requires a minimum of version 1.2.0-alpha03.

这篇关于如何制作具有三个角和阴影的图像视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆