唯客微博客

专注于计算机,嵌入式领域的技术

0%

形状(Shape)

形状(Shape)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 切角/圆角形状基类
abstract class CornerBasedShape : Shape
// 绝对切角形状
class AbsoluteCutCornerShape : CornerBasedShape
// 绝对圆角形状
class AbsoluteRoundedCornerShape : CornerBasedShape
// 切角形状
class CutCornerShape : CornerBasedShape
// 圆角形状
class RoundedCornerShape : CornerBasedShape

// 圆形
val CircleShape: RoundedCornerShape
// 常规形状, 需要自定义形状路径
class GenericShape : Shape
  • 四个角相同大小
    • CornerSize:以像素为单位定义角的大小
    • size: Dp:dp
    • size: Float:像素
    • percent: Int:百分比
  • 四个角不同大小:分别指定四个角的dp/像素/百分比
-------------本文结束感谢您的阅读-------------

本文标题:形状(Shape)

文章作者:Vinx

发布时间:2023年01月03日 - 09:56

最后更新:2023年09月18日 - 11:37

原始链接:https://blog.vinkvin.com/post/50/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。