Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9192] iOS: Repeated background image (@2x version) doesn't display correctly on a retina device.

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-07-05T12:21:46.000+0000
Affected Version/sRelease 2.0.1
Fix Version/sSprint 2012-14 Core, Release 3.0.0
ComponentsiOS
Labelscore, module_window, qe-testadded
ReporterNikhil Sharma
AssigneeMax Stepanov
Created2012-05-22T12:27:59.000+0000
Updated2012-11-27T18:07:39.000+0000

Description

When a repeated background image is used and a @2x graphic is supplied for retina devices, the @2x image doesn't display correctly.

Repo Steps

1. Run the below code in your app.js 2. Copy the attached images to the resources folder of your project. 3. In the BG Repeat tab you can see the pixellated image.
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();


//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({  
    title:'BG Repeat',
    backgroundImage:'bg.jpg',
    backgroundRepeat:true
});
var tab1 = Titanium.UI.createTab({  
    title:'BG Repeat',
    window:win1
});

//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({  
    title:'Image',
    backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({  
    title:'Image',
    window:win2
});

var image2 = Titanium.UI.createImageView({
	image:'bg.jpg'
});

win2.add(image2);



//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(tab2);  


// open tab group
tabGroup.open();

Attachments

FileDateSize
bg.jpg2012-05-22T12:31:25.000+00001714
bg@2x.jpg2012-05-22T12:31:25.000+00006866

Comments

  1. Gertjan Smits 2012-06-24

    When will this be fixed? Becoming sort of annoying now...
  2. Sindre Sorhus 2012-06-24

    ^ +1
  3. Neeraj Gupta 2012-06-24

    I have scheduled this ticket so we will get to it pretty soon.
  4. Max Stepanov 2012-07-03

    PR pending https://github.com/appcelerator/titanium_mobile/pull/2501
  5. Vishal Duggal 2012-07-05

    Resolved on master by PR 2501
  6. Satyam Sekhri 2012-08-21

    Occurs on: Titanium Studio: 2.1.2.201208192014 Titanium SDK: 2.1.2.v20120816171609 Device: iPad3 (v5.1) Fixed with SDK: 2.2.0.v20120808154112
  7. Thomas Weber 2012-11-22

    Same issue occurs on Version 2.1.4GA if "backgroundrepeat" is set. (@2x images are scaled up)
  8. Aaron Francis 2012-11-27

    I can confirm Thomas's comment that this issue is back in 2.1.4GA

JSON Source