Jacky's blog
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)

Jack Yang

编程; 随笔
首页
  • 学习笔记

    • web
    • android
    • iOS
    • vue
  • 分类
  • 标签
  • 归档
收藏
  • tool
  • algo
  • python
  • java
  • server
  • growth
  • frida
  • blog
  • SP
  • more
GitHub (opens new window)
  • tutorial
  • jetpack

  • components

  • androidx

  • 动态化
  • apm

  • module

  • harmony

  • tool

  • other

  • kotlin

  • 《android》
Jacky
2024-11-29
目录

android_snip

# 通过 ViewOutlineProvider 裁剪内容

clip 子 view 内容

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
    view.setOutlineProvider(new ViewOutlineProvider() {
        @Override
        public void getOutline(@Nullable View view, @Nullable Outline outline) {
            if (view == null || outline == null) {
                return;
            }
            view.setClipToOutline(true);
            int radius = ScreenUtil.dip2px(10);
            outline.setRoundRect(0, 0, view.getRight(), view.getBottom() + radius, radius);
        }
    });
}
1
2
3
4
5
6
7
8
9
10
11
12
13
上次更新: 2024/11/29, 23:13:56
最近更新
01
npx 使用指南
10-12
02
cursor
09-28
03
inspect
07-20
更多文章>
Theme by Vdoing | Copyright © 2019-2025 Jacky | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式