I am having a problem in tab bar(when the application loads initially
by default it displays first tab bar icon is selected and it redirect
to that page also)
Here is my code
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
- Here (when the application loads initially “search” icon is selected
by default, also it redirect to the search page , but in rhoconfig.txt
srart path is'/app/Map'
How to avoid this problem?
A tab bar is going to override the start path in your config, and it’s always going to load the first tab by default.
You can call Rho::NativeTabbar.switch_tab(1) (zero index based) after the tab bar has been created to switch your app to whatever tab you want.