Search code examples
iphoneuser-interfaceuitabbarcontrolleruiactionsheet

last Button of actionsheet does not get clicked


I have used an actionsheet in my project and when it appears it show all buttons but last (4th) button does not responds to my click(only it's half part responds)..

I know the reason it is because i have used a TabBarController and the present class is inside that tabbar controller.... only that part of the actionsheet is responding which is above the tabs....and my last button is half above and half is on top of tabbar

please help


Solution

  • i suggest using this:

    [actionSheet showInView:[UIApplication sharedApplication].keyWindow];
    

    I had the same problem that you have and using this method to show it worked for me. The TabBar wants to stay key Window what makes your bottom button appear above, but is actually under the tabbar.

    Hope this does the trick for you..

    Edit

    If you use landscape mode and the method above doesn't work. You can use the following fix:

    @Vinh Tran: [sheet showFromTabBar:self.parentViewController.tabBarController.tabBar]