[TIMOB-8968] iOS: titleControl property is positioning the image on top/left corner
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-05-07T11:20:01.000+0000 |
| Affected Version/s | Release 2.1.0 |
| Fix Version/s | Release 2.0.2, Release 2.1.0, Sprint 2012-10 API |
| Components | iOS |
| Labels | SupportTeam, api, module_window, qe-testadded, regression |
| Reporter | Federico Casali |
| Assignee | Vishal Duggal |
| Created | 2012-05-02T18:21:34.000+0000 |
| Updated | 2012-07-09T10:43:06.000+0000 |
Description
Problem description
Using titleControl property to set the view to show in the navbar. View's backGroundImage is positioned on top/left corner of the windows navbar instead of in the center. Attaching screenshotCode sample
Attached the background image used (ing_logo_header.png)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
var win = Titanium.UI.createWindow({
backgroundColor:'white',
title:'window',
barColor:'#ff7b01',
top:0,
navBarHidden:false
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win
});
var titleImage = Ti.UI.createView({
width:94,
height:24,
// center
backgroundImage:'/ing_logo_header.png',
});
win.titleControl = titleImage;
//win.open();
tabGroup.addTab(tab1);
tabGroup.open();
Attachments
| File | Date | Size |
|---|---|---|
| ing_logo_header.png | 2012-05-02T18:21:34.000+0000 | 5812 |
| Screen Shot 2012-05-02 at 4.27.33 PM.png | 2012-05-03T03:04:20.000+0000 | 96676 |
Broken due to the fix in TIMOB-8613.
Test Code. This includes the test case from TIMOB-8613
Titanium.UI.setBackgroundColor('#000'); // create tab group var tabGroup = Titanium.UI.createTabGroup(); var titleImage = Ti.UI.createView({ width:94, height:24, backgroundImage:'/ing_logo_header.png', }); var titleView = Ti.UI.createView({}) var label = Ti.UI.createLabel({ text:'LONG TEXT WILL NOT FIT IN PORTRAIT', top:10 }) titleView.add(label); var label2 = Ti.UI.createLabel({ text:'LONG2 TEXT WILL NOT FIT IN PORTRAIT', top:10 }) var win = Titanium.UI.createWindow({ backgroundColor:'white', title:'window', barColor:'#ff7b01', top:0, navBarHidden:false }); win.orientationModes = [Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT]; var tab1 = Titanium.UI.createTab({ icon:'KS_nav_views.png', title:'Tab 1', window:win }); var btn1 = Ti.UI.createButton({ top:10, height:30, title:'Test Label' }) btn1.addEventListener('click',function(){ win.titleControl = label2; }) var btn2 = Ti.UI.createButton({ top:45, height:30, title:'Test Image' }) btn2.addEventListener('click',function(){ win.titleControl = titleImage; }) var btn3 = Ti.UI.createButton({ top:80, height:30, title:'Test View' }) btn3.addEventListener('click',function(){ win.titleControl = titleView; }) win.add(btn1); win.add(btn2); win.add(btn3); //win.open(); tabGroup.addTab(tab1); tabGroup.open();Adding merge label since TIMOB-8613 was merged into 2_0_X
Tested with 2.0.2.v20120510223154 on iPhone 4 5.0.1