自定义形状按钮Android [英] Custom Shape Button Android

查看:121
本文介绍了自定义形状按钮Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须解决这种类型的视图,该视图在示例下方带有按钮. http://www.planet1107.net/blog/custom-shape-uibutton-教程/

I have to address this type of views which has buttons below example. http://www.planet1107.net/blog/custom-shape-uibutton-tutorial/

它在iOS中.所以有什么办法可以在Android中做到这一点. 我还必须为所有这些按钮提供单击事件.

It is in the iOS. so is there any way to make it in Android. I also have to give click events on all of those buttons.

推荐答案

我建议仅将这些自定义图像导出为png.然后将png添加到您的Android项目中,并简单地在代码或XML中引用它们.然后,在单击事件中,您可以简单地更改图标以表明它已被单击,如果用户再次单击它,则将其更改回原来的状态.

I would recommend just exporting these custom images to pngs. Then adding the pngs to your Android project and simply referencing them in the code or XML. Then on a click event you can simply change the icon to indicate that it has been clicked and if the user clicks on it one more time change it back.

这还将确保Android图像看起来与iOS图像相同.

This will also ensure that the Android images look identical to the iOS ones.

这篇关于自定义形状按钮Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆