質問

これが私のコードです:

Mainview:

NSArray *btArray = [NSArray arrayWithObjects:@"1",@"1",@"1",@"1",@"1",nil];
ButtonBarComponent *bottomeButtonBar = [[ButtonBarComponent alloc] initButtonBarComponentWithButtonArray:btArray];
bottomeButtonBar.frame = CGRectMake(0, 340, 320, 200);
[self.view addSubview:bottomeButtonBar];

サブビュー:

-(id)initButtonBarComponentWithButtonArray:(NSArray *)btArray {
self = [[UIView alloc] initWithFrame:CGRectMake(0, 340, 320, 200)];
self.backgroundColor = [UIColor whiteColor];
}

しかし、なぜタッチイベントでコードを実行できないのですか?

役に立ちましたか?

解決

ビューとサブビューのためにユーザーインタラクションを有効に設定してみてください

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top