Button and Image Property (Andriod)

You must Login before you can answer or comment on any questions.

function renderRadio(row,checked) {
    var baseImage = Titanium.UI.createImageView({
        image : dir_path.R + 'images/ui/icons.png',
        width : 39,
        height : 600
    });
 
    // Here's the view we'll use to do the cropping.
    // It's never displayed either.
    var cropView = Titanium.UI.createView({
        width : 40,
        height : 40
    });
 
    // Add the image to the crop-view.
    // Position it left and above origin.
    cropView.add(baseImage);
    if (checked) {
        baseImage.left = 10;
        baseImage.top = -280;
    } else {
        baseImage.left = 10;
        baseImage.top = -225;
    }
 
    // now convert the crop-view to an image Blob
    var croppedImage = cropView.toImage();
 
    var radioBtn = Ti.UI.createButton({
        right : 10,
        width : 40,
        height : 40,
        image : croppedImage,
        backgroundImage : 'transparent'
    });
 
    row.add(radioBtn);
}
I have this image which contains lots of icons. So I am selecting a section to display in a table row. I am using 'image' property to do this. This work fine for the iPhone, but Andriod displays nothing.

Any way to get it to work for andriod?

Your Answer

Think you can help? Login to answer this question!