Android: can I create a view/canvas that is not rectangular, but e.g. round?

前端 未结 3 1302
故里飘歌
故里飘歌 2021-02-07 21:55

I have a view that is round and hovering above (-> in z-axis direction coming out of the screen) the main content. When the someone taps the screen I want either the main conten

3条回答
  •  别那么骄傲
    2021-02-07 22:10

    Probably not relevant to the original asker anymore, but for anyone who's still looking, it looks like this will be added in L: https://developer.android.com/preview/material/views-shadows.html#clip. The View.setClipToOutline method allows you to clip a view to the shape of a rectanglular, circular, or round rectangular drawable.

提交回复
热议问题