ios - Can interact with views under my custom view -


i create custom view using .xib. add programatically view. here code init view inside custom view:

- (id)initwithframe:(cgrect)frame {     self = [super initwithframe:frame];     if (self) {         // load .xib         [[nsbundle mainbundle] loadnibnamed:@"customview" owner:self options:nil];          // add sub view         [self addsubview:self.view];     }     return self; } 

here code add custom view view:

customview *desview = [[customview alloc] init];  [self.view addsubview:desview]; [self.view bringsubviewtofront:desview]; 

however, custom view on top of other views still can interact these views. had tried bring front no use.

how can disable interaction views can still interact custom view?

thanks lot helping.

set when want disable user interaction of view want.

[self.view setuserinteractionenabled:no]; 

or if want disable desview,

[desview setuserinteractionenabled:no]; 

Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -