Is there a way to create a triangular button on Android?

南笙酒味 提交于 2019-12-06 11:40:22

You can override the OnTouch Event method in a CustomView / CustomButton

Inside you have the MotionEvent were you can check if the Touch was inside your Triangle (with the help of some mathematics :P)

If you want to get exotic with non-rectangular views, then you will want to create a custom View. There is lots of information available on the web, but some of the best can be found on the Android documentation site:
http://developer.android.com/guide/topics/ui/custom-components.html#custom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!