문제

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??

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top