Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16098] Android: ImageView doesn't display child views

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, defect, parity
ReporterSven Herzberg
AssigneeUnknown
Created2012-01-10T07:45:30.000+0000
Updated2018-02-28T20:03:13.000+0000

Description

On iOS, Ti.UI.ImageView displays subviews, on Android, it doesn't.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();

var win;
var tab;
var view;
var label;
win = Titanium.UI.createWindow({
    backgroundColor:'#fff',
    title: 'View'
});
tab = Titanium.UI.createTab({
    icon:   'KS_nav_views.png',
    title:  win.title,
    window: win
});
view = Titanium.UI.createView();
label = Titanium.UI.createLabel({
	color:'#000',
	text:'I am Window 1',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});
win.add(view);
view.add(label);
tabGroup.addTab(tab);

//
// create controls tab and root window
//
win = Titanium.UI.createWindow({
    backgroundColor:'#fff',
    title:  'ImageView'
});
tab = Titanium.UI.createTab({
    icon:   'KS_nav_ui.png',
    title:  win.title,
    window: win
});
view = Titanium.UI.createImageView({});
label = Titanium.UI.createLabel({
	color:'#000',
	text:'I am Window 2',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});
win.add(view);
view.add(label);
tabGroup.addTab(tab);

// open tab group
tabGroup.open();
On iOS, you can see each label ("I am Window 1" and "I am Window 2") depending on which tab is selected. On Android, you can only see "I am Window 1" on the first tab; the second seems to be just blank.

Comments

  1. Paul Dowsett 2012-01-10

    This is an anomalous issue with iOS, as only standard views and windows should contain childrenm, by design. Closing as "invalid", but have raised TIMOB-7057 to address the parity issue. By the way, your test case contained unnecessary code. Please see the test case in TIMOB-7057 for a better example. Thanks
  2. Paul Dowsett 2012-01-10

    A ticket needs to prove the existence of a bug, for it to be accepted. I'm afraid that this does not, in its current form. Please kindly refer to the [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) guide to learn how tickets need to be filed. Please also remember to raise a [Q&A question](http://developer.appcelerator.com/questions/created) (and to allow time for people to respond) before opening a ticket. Thank you

JSON Source