Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

TABBED BAR ABNORMAL BEHAVIOUR

$
0
0

var self = Ti.UI.createWindow({
        title:title,
        backgroundColor:'white'
    });
 
    var tb1 = Titanium.UI.iOS.createTabbedBar({
        labels:['METRIC', 'STANDARD'],
        backgroundColor:'#336699',
        top:150,
        style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
        height:25,
        width:180,
         index: 0
    });
 
    self.add(tb1);
 
tb1.addEventListener('click', function(e){
        if (e.index==0) {
        metric();
        };
        if (e.index==1) {
        standard();
        };
 
    });
    function metric(){
            weightlabel.text='Kg';
            heightlabel.text='Cms';
 
    }
    function standard(){
            weightlabel.text='Pounds';
            heightlabel.text='Inches';
 
    }
Both the options are getting selected when we run this code

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>