Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 869
Ranjeet Sajwan Avatar asked Dec 15 '10 07:12

Ranjeet Sajwan


2 Answers

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]

like image 60
stackr Avatar answered Nov 02 '22 22:11

stackr


What method do you use to show your actionsheet. Try showFromTabBar: method

like image 37
Vladimir Avatar answered Nov 02 '22 22:11

Vladimir