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

Prototype problem

$
0
0

Hi people! I'm a little bit confuse about prototyping...My code is:

function Upbar(){
 
    var self = Ti.UI.createView({
        width:'100%',
        height:63,
        backgroundColor:'transparent',
        layout:'vertical',
        top:0
    });
 
    var menu = Ti.UI.createView({
        width:'100%',
        height:50,
        backgroundColor:'#323a45',
        top:0
    });
 
    this.line = Ti.UI.createView({
        width:'100%',
        height:13,
        backgroundColor:'#d44c4c',
        top:0
    });
 
    self.add(menu);
    self.add(this.line);
 
    return self;
};
 
Upbar.prototype.getLineColor = function(){
    Ti.API.info(this.line.backgroundColor);
};
 
module.exports = Upbar;
This is a module that I call Upbar. When I try to call the function "getLineColor", like this:
var Upbar = require('ui/common/Upbar');
var upbar = new Upbar();
upbar.getLineColor();
I got no errors and no prints. Why? Can anyone help me? Thanks a lot!

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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