如何创建具有3个选项切换按钮...? [英] How to create a toggle button with 3 options...?

查看:175
本文介绍了如何创建具有3个选项切换按钮...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用3个选项创建一个切换按钮。
我不想使用单选按钮或复选框。

I want to create a toggle button with 3 options. I don't want to use radio button or check box.

我要创建这样的....

I want to create like this....

如何建立这个......?

How to create this...?

在此先感谢...!

推荐答案

左/中/右按钮创建的艺术品和水平线性布局创建相邻的三个独立按键

Create the artwork for the left/middle/right buttons and create three separate buttons next to each other in a horizontal linear layout

然后在code得到所有三个引用到按钮。当按钮被点击设置一个布尔值,例如_button1Clicked = TRUE(或使用数组?)和图像设置为唐斯泰特,检查其他按钮,设置它们的图像北部和布尔值重置为假的!

Then in code get all three references to the buttons. When a button is clicked set a boolean e.g _button1Clicked = true (or use an array?) and set the image to a downstate, check the other buttons, set their images to upstate and reset their booleans to false!

轻松!

这篇关于如何创建具有3个选项切换按钮...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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