objective c how to set exclusive touch for all UIbuttons on the whole app(目标c如何为整个应用程序上的所有UIbuttons设置独家触摸)

本文介绍了目标c如何为整个应用程序上的所有UIbuttons设置独家触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序有很多按钮

My app has many buttons through out the application

我想一次将所有这些都设置为 Exclusive Touch.或应用中的所有视图

我们可以单独设置

[button setExclusiveTouch:YES];

但我想一次设置应用程序中的所有按钮

But i want to set at a time for all the buttons in the application

我们可以设置所有视图独占触摸吗?

任何人有任何想法请建议我.

any body have any idea please suggest me.

推荐答案

你可以试试这个

// Not tested
for (UIView * button in [myView subviews]) {
    if([button isKindOfClass:[UIButton class]])
        [((UIButton *)button) setExclusiveTouch:YES];
}

这篇关于目标c如何为整个应用程序上的所有UIbuttons设置独家触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!