我的按钮如下UIButton的自定义视图 - addTarget:动作:forControlEvents:不工作
- 创建LABEL1
- 创建LABEL2
- 创建customView(
UIView
) - 添加label1和label2自定义视图
- 创建myCustomButton(
UIButton
) - 在myCustomButton上添加customView
我已经为custom_View,label1和label2做了userInteractionEnable。
然后加入
[myCustomButton addTarget:self action:@selector(OnButtonClick:) forControlEvents:UIControlEventTouchUpInside];
而且
-(void)OnButtonClick:(UIButton *)sender
{
}
但上述功能,甚至当我触摸按钮永远不会被调用。任何解决方案
请把您的相关代码放在这里? – 2013-05-08 13:56:10