I have a view, with a navigationBar on top. I add a subview in this view. My subview is a view with a toolBar.
SecondView.frame = CGRectMake(0, 418, 320, 42);
[principalView addSubview:SecondView];
[principalView bringSubviewToFront:SecondView];
After that, the subView is in my principalView, at the right place, but when I click in the subView, nothing happen.
But, if my navigationBar is like this, all works perfectly,
self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
Why the subview do nothing if my navigationBarStyle is UIBarStyleDefault.
I think your
SecondViewhas fallen out of yourprincipalViewbounds. If that’s the case, it will still be visible because principalView does not clip subviews, butSecondViewwill not respond to user action. You should check theprincipalView.boundsproperty againstSecondView.frame.