如何创建一个布局多数民众赞成分裂和对角的两半可点击? [英] How to create a layout that's split diagonally and the two halves are clickable?
本文介绍了如何创建一个布局多数民众赞成分裂和对角的两半可点击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要创建一个布局多数民众赞成对角分割屏幕分为两部分用不同的颜色作为他们background.Something是这样的:
I need to create a layout that's split the screen diagonally into two parts with different colors as their background.Something like this:
我怎样才能做到这一点?
How can I achieve this?
推荐答案
应该可以创建一个视图作为背景,然后把它上面的一个又一个具有45度角。把既有的FrameLayout里面再次夹在一个矩形。你可以指定一个onclick处理程序,以他们每个人。
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.
这篇关于如何创建一个布局多数民众赞成分裂和对角的两半可点击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文