开发者

How to handle the touches event in subView

开发者 https://www.devze.com 2023-03-01 16:25 出处:网络
Here is my code: mainView: NSArray *btArray = [NSArray arrayWithObjects:@\"1\",@\"1\",@\"1\",@\"1\",@\"1\",nil];

Here is my code:

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.vie开发者_如何学Gow addSubview:bottomeButtonBar];

subView:

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

but why I cant run the code in touches event?


try setting user interaction enabled for your view and subview

0

精彩评论

暂无评论...
验证码 换一张
取 消