How to create a layout that's split diagonally and the two halves are clickable?

前端 未结 3 2023
傲寒
傲寒 2020-12-29 11:31

I need to create a layout that\'s split the screen diagonally into two parts with different colors as their background.Something like this:

3条回答
  •  轮回少年
    2020-12-29 11:55

    It should be possible to create a View as the background, then put another one above it with a 45 degree angle. Put both inside a FrameLayout to clip it to a rect again. You may assign a onClick handler to each of them.

提交回复
热议问题