this question has been asked many times before , think i've read of threads still can't find reason behavior in code.
i create custom uiview (called bview) programmatically this:
cgrect frame = [[uiscreen mainscreen] applicationframe]; _view = [[bview alloc] initwithframe:frame]; [[[[uiapplication sharedapplication] windows] objectatindex:0] addsubview:_view]; when initializing set userinteractionenabled both view , superview yes , background color black, because i've read had these problems because background transparent:
[self setuserinteractionenabled:yes]; [self.superview setuserinteractionenabled:yes]; [self setbackgroundcolor:[uicolor blackcolor]]; still functions receive touch events not called:
/* receive touch events: touch began */ - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { [super touchesbegan:touches withevent:event]; brenderer::log("touch began"); [...] } /* receive touch events: touch moved */ - (void)touchesmoved:(nsset *)touches withevent:(uievent *)event { [super touchesmoved:touches withevent:event]; brenderer::log("touch moved"); [...] } /* receive touch events: touch ended */ - (void)touchesended:(nsset *)touches withevent:(uievent *)event { [super touchesended:touches withevent:event]; brenderer::log("touch ended"); [...] } somewhere in project there view controller receives touch events without problems , no errors anywhere in project. yet quite important me receive touch events in view instead of controller. don't wrong here.
thank help
Comments
Post a Comment