iphone - How to handle the touches event in subView -
here 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.view addsubview:bottomebuttonbar];
subview:
-(id)initbuttonbarcomponentwithbuttonarray:(nsarray *)btarray { self = [[uiview alloc] initwithframe:cgrectmake(0, 340, 320, 200)]; self.backgroundcolor = [uicolor whitecolor]; }
but why cant run code in touches event?
try setting user interaction enabled view , subview
Comments
Post a Comment