0

I need a view that need to be common for application.I am adding the view to new uiwindow,because the view should not navigate to other screen,it needs to be common.That is reason i am setting on separate uiwindow as per reference of [http://b2cloud.com.au/tutorial/multiple-uiwindows/] .But here is the actual problem.I am adding a button on top of new UIwindow and unable to select ,because user interaction disabled for it.Added the code below.

topWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 200)];
[topWindow setWindowLevel:UIWindowLevelAlert];
[topWindow setRootViewController:viewController];
[topWindow setHidden:NO];
[topWindow setUserInteractionEnabled:NO];

If i set topWindow setUserInteractionEnabled:YES]; then i am unable to touch main window. I want some thing like user interaction enabled for topWindow button and i need user interaction for main UIWindow too.

Leandro Bardelli
  • 10,561
  • 15
  • 79
  • 116
sairam
  • 299
  • 1
  • 6
  • 17

2 Answers2

0

Are you sure you need to create a UIWindow? When I have an alert that may appear any time, without regard to view hierarchy, I just add a UIView as a subview of the main UIWindow, without any UIViewController. Maybe that will work for you.

user1055568
  • 1,349
  • 13
  • 21
0

Thanks for the response.Sorry for the late answer.

I have done this with the help of Container View in iOS.Created a fake view controller with container view and added the fake view controller to the root view controller.It works like charm.

Thanks.

sairam
  • 299
  • 1
  • 6
  • 17