UIButton does not get touched when supervisor has position

I have a view that has three buttons. If I set the zPosition for the view to be on top, the buttons located on it do not receive strokes.

However, as soon as you leave the zPosition of the default view, the buttons will start receiving strokes. I have checked all the usual suspects that brought ToFront and so on and nothing seems to work.

What is wrong here, there is some significant gap in my understanding.

self.dropDownMenu.layer.shadowColor = [UIColor blackColor].CGColor;
self.dropDownMenu.layer.shadowOffset = CGSizeMake(0.0, -3.0);
self.dropDownMenu.layer.shadowOpacity = 0.5;
self.dropDownMenu.layer.shadowRadius = 4.0;
self.dropDownMenu.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.dropDownMenu.bounds].CGPath;
self.dropDownMenu.layer.zPosition = 20.0;
[self.dropDownMenu bringSubviewToFront:self.breakfastBtn];

      

+3


source to share





All Articles