Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

可以只给banner的底部两个角设置为圆角,顶部不设置么? #202

Closed
ydslib opened this issue May 12, 2021 · 2 comments
Closed

Comments

@ydslib
Copy link

ydslib commented May 12, 2021

可以只给banner的底部两个角设置为圆角,顶部不设置么?

@ydslib
Copy link
Author

ydslib commented May 13, 2021

已解决

class BannerViewOutlineProvider : ViewOutlineProvider() {

    override fun getOutline(view: View?, outline: Outline?) {
        Log.e("BannerViewOutline", "${view!!.width}:${view.height}")
        val selfRect = Rect(0, -200, view!!.width, view.height)
        outline!!.setRoundRect(selfRect, 100f)
    }
}
banner.clipToOutline = true // 用outline裁剪内容区域

banner.outlineProvider = BannerViewOutlineProvider()

@zhpanvip
Copy link
Owner

3.5.2发布,支持setRoundCorner(int,int, int,int).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants