Domanda

I made a custom UIAlertView as Follows :- 1) I made a subclass of UIView which is of the size of the UIWindow and made its background Color as Clear , I made such so that , the user is not able to click on anything except the popupView 2) then I created a small popupView which is the actual AlertView , which is at fixed location of (20,100,300,150) 3)then i need to add this to parentView on Clicking a button as follows and then show it

[parentView.view addSubView:CustomAlertView];
[CustomAlertView show];

This works fine on a normal UI of normal size, but when i use UITableView , and if scroll down to lower cells , then the AlertView does not appear as it has fixed location and it has appeared above , for which i need to scroll up to see the popupView ,

Is there any way so that i can use the same approach but the popupView is visible for cells at bottom also , because i dont a change lot in my code as the code is very big??

È stato utile?

Soluzione

Don't add your custom alert view to the view controller's view. You should either add the alert to the main window or better yet, add a second window with a level of UIWindowLevelAlert and add your alert view to this additional window. Then make the 2nd window the key and visible window. When dismissed, remove the window and make the old window key again.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top