mirror of
https://github.com/zhigang1992/ProMotion.git
synced 2026-06-02 06:49:45 +08:00
Merge pull request #76 from rheoli/version-0.6-split-tabbar
TabBar title and icon for SplitScreen
This commit is contained in:
@@ -19,7 +19,11 @@ module ProMotion
|
||||
|
||||
[ master, detail ].map { |s| s.on_load if s.respond_to?(:on_load) }
|
||||
|
||||
split_screen_controller master, detail
|
||||
split = split_screen_controller master, detail
|
||||
if args.has_key?(:icon) or args.has_key?(:title)
|
||||
split.tabBarItem = create_tab_bar_item(args)
|
||||
end
|
||||
split
|
||||
end
|
||||
|
||||
def open_split_screen(master, detail, args={})
|
||||
@@ -39,4 +43,4 @@ module ProMotion
|
||||
svc.detail_screen.navigationItem.leftBarButtonItem = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
0
resources/list.png
Executable file → Normal file
0
resources/list.png
Executable file → Normal file
|
Before Width: | Height: | Size: 104 B After Width: | Height: | Size: 104 B |
@@ -6,7 +6,7 @@ describe "split screen in tab bar functionality" do
|
||||
@master_screen = HomeScreen.new nav_bar: true
|
||||
@detail_screen = BasicScreen.new nav_bar: true
|
||||
|
||||
@split_screen = @app.create_split_screen @master_screen, @detail_screen
|
||||
@split_screen = @app.create_split_screen @master_screen, @detail_screen, icon: "list", title: "Spec"
|
||||
@tab = @app.open_tab_bar @split_screen, HomeScreen, BasicScreen
|
||||
end
|
||||
|
||||
@@ -49,5 +49,18 @@ describe "split screen in tab bar functionality" do
|
||||
it "should set the tab bar first viewController to the split screen" do
|
||||
@tab.viewControllers.first.should == @split_screen
|
||||
end
|
||||
|
||||
it "should set the bar bar item for the split screen" do
|
||||
@split_screen.tabBarItem.is_a?(UITabBarItem).should == true
|
||||
end
|
||||
|
||||
it "should set the tab bar icon of the split screen" do
|
||||
@split_screen.tabBarItem.image.is_a?(UIImage).should == true
|
||||
end
|
||||
|
||||
it "should set the tab bar title of the split screen" do
|
||||
@split_screen.tabBarItem.title.is_a?(String).should == true
|
||||
@split_screen.tabBarItem.title.should == "Spec"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user