Xcode Adding Subview Full Screen Above All

I want to use the addSubview method to add a new view to my screen. However, the new view should also include a navigation bar, etc., which means that it should include the entire screen. What should I do?

Whenever I try addSubview, it always shows a new view in the navigation bar.

I don’t want to use pushViewController or presentModelViewController because the newly added view will be low opacity and I can see the background, but I don’t want to interact with the background, Sorry for the English, I hope I clearly said that the problem.

+5
source share
3 answers

frame , , .

[myView setFrame:[[UIScreen mainScreen] bounds];
[self.navigationController.view addSubview:myView];

:

[self.navigationController.navigationBar setUserInteractionEnabled:NO];
+16

UIWindow .

+1

when I tried to make navigationController.view addSubview it won’t close the tab bar, so I did the following with my app delegation window:

[self.window addSubview:myView];

if you need access to your appDelegate from another class, you simply import the application delegate and call it from this.

0
source

All Articles