HELP Please! cannot open center when center is a tabbar controller.
anguskwan opened this issue · comments
class AppDelegate < PM::Delegate
include GlobalStyle
def on_load(app, options)
set_navigationbar_style
open_home
end
def open_home
@menu = open MenuDrawer
end
def show_menu
puts "show menu clicked"
@menu.show :left
end
end
class MenuDrawer < PM::Menu::Drawer
def setup
self.center = HomeScreen.new(nav_bar: true)
self.left = MenuScreen
self.to_show = [:pan_bezel, :pan_nav_bar]
self.max_left_width = 250
self.shadow = true
end
end
class HomeScreen < PM::Screen
title "Home"
attr_accessor :share_screen, :nearby_screen, :post_screen, :health_screen, :my_screen
def on_load
@share_screen = ShareScreen.new(nav_bar: true)
@nearby_screen = NearbyScreen.new(nav_bar: true)
@post_screen = PostScreen.new(nav_bar: true)
@health_screen = HealthScreen.new(nav_bar: true)
@my_screen = MyScreen.new(nav_bar: true)
@tabbar_controller = open_tab_bar([@share_screen, @nearby_screen, @post_screen, @health_screen, @my_screen])
@tabbar_controller.delegate = self
end
class ShareScreen < PM::Screen
include GlobalStyle
title "GouBGouM"
tab_bar_item item: { selected: "share_tab".uiimage, unselected: "share_tab_unselected".uiimage }, title: "首页"
def on_load
init_ui
end
def init_ui
self.view.backgroundColor = :white.uicolor
set_navigationbar_style
set_navigationbar_button
end
end
when i clicked left button on navigation bar, it just not show the left drawer..
if i replace the Center Controller with a screen without tabbar, it will show as expected.
@anguskwan I'm looking into it. Did you get an exception or did it just silently fail?
@anguskwan Unfortunately it appears the underlying cocoapod we use doesn't support container view controllers other than UINavigationController as the center view controller. There's an open issue that describes a hacky work around but it doesn't look like they'll be supporting UITabBarController any time soon.
@jamonholmgren @macfanatic Any ideas for potential workarounds?
Unfortunately, no. :-/ You might have to use a third party tab bar controller like RDVTabBarController or M13InfiniteTabBar and embed them in a nav bar.
@ryanlntn it just keep siliently.
@jamonholmgren i am going to have to try. i used a custom tabbar, add it to nav bar controller, and view added below tabbar, maybe it will work.
thanks guys.
@anguskwan Let us know if it does so we can add it to the README. I'm closing this for now.