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

button with label and icon

$
0
0

I am trying to build a button with an icon logo and with a label my project is only for ipad

icon and button are shown properly but not the label

var iconImg = Ti.UI.createImageView({
            image : 'icon.jpg',
            top: 0,
            width:30, 
            height:30
 
        });
 
        var nameLabel = Ti.UI.createLabel({
            color:'#0000',
            text:'test',
                height:'auto',
                width:'auto', 
                textAlign : 'center',
                font: {
                    fontFamily: 'Arial',
                    fontsize:'12sp'
                },
                bottom:0
           });
 
        var button = Ti.UI.createView({
            left:200,
            width: 70,
            height:70,
            backgroundColor: '#aaaa',
        });
            button.addEventListener('click', function(e){alert('click');});
            button.add(iconImg);
            button.add(nameLabel);
I tried also with a view instead of button

any help will be appreciate

Thanks


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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