我只使用促销菜单的自述文件中显示的代码做了一个新项目。我有这个 :
# app_delegate.rb
class AppDelegate < PM::Delegate
def on_load(app, options)
@menu = open MenuDrawer
end
def show_menu
@menu.show :left
end
end
#menu_drawer.rb
class MenuDrawer < PM::Menu::Drawer
def setup
self.center = HomeScreen.new(nav_bar: true)
self.left = NavigationScreen
self.to_show = [:pan_bezel, :pan_nav_bar]
self.transition_animation = :swinging_door
self.max_left_width = 250
self.shadow = false
end
end
#navigation_screen.rb
class NavigationScreen < ProMotion::TableScreen
def table_data
[{
title: nil,
cells: [{
title: 'OVERWRITE THIS METHOD',
action: :swap_center_controller,
arguments: HomeScreen
}]
}]
end
def swap_center_controller(screen_class)
app_delegate.menu.center_controller = screen_class
end
end
我的应用程序正在运行,但没有侧边栏,您可以在此处看到:
我错过了什么 ?