Type Function Library widget.* Return value none Revision Release 2022.3683 Keywords widget, tab bar, TabBarWidget, setSelected See also widget.newTabBar() TabBarWidget
Use this method to set a specific TabBarWidget button to its "selected" state. Optionally, you can invoke the onPress
listener for the button at the same time.
object:setSelected( buttonIndex ) object:setSelected( buttonIndex, simulatePress )
Boolean. If set to true
, the tab button specified by buttonIndex
will have its onPress
listener function called. The default is false
, meaning that the tab button will appear "selected" but the listener function will not be called.
-- Select the third tab tabBar:setSelected( 3 ) -- Select the second tab button and invoke its listener function tabBar:setSelected( 2, true )