Total Pageviews

Tuesday, June 3, 2014

នេះជា Type TabBarWidgets របស់ Corona SDK

នេះជា Type TabBarWidgets របស់ Corona SDK
សំរាប់ TabBar objects ត្រូវបានបង្កើតឡើងដោយប្រើ widget.newTabBar()
នេះជា Methods របស់វា
Object:setSelected() ការប្រើនៅវិធីនេះសំរាប់ TabBar button ទៅកាន់ selected state។ ជាជំរើសវាអាច invoke នៅលើ onPress listener សំរាប់ ​button នៅពេលដូចគ្នា
Syntax: object:setSelected (buttonIndex)
Object:setSelected (buttonIndex, simulatePress)
buttonIndex (តំរូវការ) វាជាចំនួនលេខដែល button index នៅលើ tab bar ចាប់ផ្តើមជាមួយនឹង១ បង្ហាញថា button ចេញពីឆ្វេង
simulatePress (ជំរើស) វាជា Boolean បើសិនជាបញ្ចូលជា true the tab button តាមរយះ buttonIndex វានឹងមាន onPress listener function calledthe default is false មានន័យថា tab button នឹងបង្ហាញការ selected ប៉ុន្តែ listener function មិនត្រូវបានយកមកប្រើ
សូមមើលកូដះ
-- Select the 3rd tab.
tabBar:setSelected( 3 ) 

-- Select the 2nd tab button and invoke its listener function
tabBar:setSelected( 2, true )


No comments:

Post a Comment