Q.u.a.n.g L.
Q.u.a.n.g L.

Reputation: 1614

How to lay a view above all of every tabbar view

I have 2 questions:

The 1st one is: I want to put a view that contain many buttons above the tab bar view. Even if I switch to whatever tab, I want to see that view. How is it possible?

The 2nd: Can I handle the event when i click to the button inside that view? How to get that?

Any suggestion is welcome. Thanks.

Upvotes: 4

Views: 1705

Answers (2)

matt
matt

Reputation: 535944

Make a custom parent view controller. Make the tab bar controller its child. Now you custom parent view controller can contain two views: the many-buttons view, and the tab bar controller's view.

The nice thing about this solution is that it can be configured with no code at all, entirely in the storyboard:

enter image description here

Upvotes: 2

Toni lee
Toni lee

Reputation: 485

Try create a UIWindow and set it's windowLevel to UIWindowLevelAlert. Then call it's makeKeyAndVisible to show it. Add your button in it.

Upvotes: 0

Related Questions