Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8260] Android: imageView or View doesn't show when added to button

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2012-03-23T19:16:42.000+0000
Affected Version/sRelease 1.8.0.1, Release 2.0.0, Release 1.8.1, Release 1.8.2
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterNikhil Sharma
AssigneeMarshall Culpepper
Created2012-03-23T16:18:47.000+0000
Updated2017-03-09T23:21:36.000+0000

Description

If we add imageView or view to the button, then the imageView doesn't show. It works in iOS, I can view an imageView or View added to the button.

Repro Steps

1. Run the below code in the app.js 2. After running the application, you can only see the button without an imageView or view added to the it.
var win = Ti.UI.createWindow({
	backgroundColor: "red"
});
var label = Ti.UI.createLabel({
	text: 'Button',
	color: 'white'
});
var button = Ti.UI.createButton({
	title:'Click',
	height:100,
	width: 100,
	textAlign: 'left'
});

var image = Titanium.UI.createImageView({ 
	backgroundImage:'KS_nav_ui.png', 
	backgroundColor:'black',
        top:10, 
        left:47, 
        height:50, 
        width:50,
        touchEnabled: false 
});
button.add(image);
win.add(button);
win.open();

Comments

  1. Neeraj Gupta 2012-03-23

    Not sure if we support adding views to buttons on Android.
  2. Neeraj Gupta 2012-03-24

    We do not allow views to be added to button on Android platform.
  3. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source