检测段上的第二次点击 [英] Detect second click on a segment

查看:37
本文介绍了检测段上的第二次点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据文档,应该与 UISegmentedControl 相关的事件值已更改.假设我有一个带有上一个和下一个的分段控件,在我的情况下,我应该能够多次单击下一个,UISegmentedControl 的默认行为将无法识别成功第二次单击同一段.那么如何处理呢?

According to the documentation, the event which should related to UISegmentedControl is value changed. Assuming I have a segmented control with previous and next, in my case I should be able to click next more than one time, the default behaviour of UISegmentedControl will not recognize the successif second click on same segment. SO how to deal with that?

推荐答案

将 UISegmentedControl 的 momentary 属性设置为 TRUE.

Set the momentary property of your UISegmentedControl to TRUE.

您可以在代码或 Interface Builder 中执行此操作(属性检查器中有一个复选框).

You can do that in code or in Interface Builder (there is a checkbox in the Attributes Inspector).

这篇关于检测段上的第二次点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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