2011-08-19 19 views
0
我有在標籤欄的問題

選擇(當應用程序加載最初 默認它顯示被選擇的第一標籤欄圖標並將其重定向 到該網頁也)標籤欄第一圖標被默認羅德

這裏是我的代碼

class AppApplication < Rho::RhoApplication 
def initialize 
    tabbar = [ 
    {:label => 'search', :action => '/app/Search', :icon => '/ 
public/images/Icons/search.png', :reload => true}, 
    {:label => 'map', :action => '/app/Map', :icon => '/public/ 
images/Icons/map.png', :reload => true}, 
    {:label => 'menu', :action => '/app/Account', :icon => '/public/ 
images/Icons/menu.png', :reload => true}, 
    {:label => 'businesses', :action => '/app/Work', :icon => '/ 
public/images/Icons/businesses.png', :reload => true}, 
    {:label => 'reviews', :action => '/app/Review', :icon => '/ 
public/images/Icons/reviews.png', :reload => true} 
    ] 
    Rho::NativeTabbar.create(:tabs => tabbar, :place_tabs_bottom => 
true) 
    @@toolbar = nil 
    super 
end 
end 
  • 這裏(當應用程序加載初始「搜索」圖標選擇 默認情況下,也將其重定向到搜索頁面,但在rhoconfig.txt srart路徑'/app/Map'

如何避免此問題?

回答

0

標籤欄將覆蓋配置中的開始路徑,並且默認情況下它總是會加載第一個標籤。

在創建標籤欄之後,您可以調用Rho :: NativeTabbar.switch_tab(1)(基於零索引),以將您的應用切換到您想要的任何標籤。