私のボタンは次のとおりです
- ラベル1を作成しました
- 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
{
}
しかし、ボタンをタッチしても上記の関数は呼び出されません。解決策はありますか?