Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

iPhone: possible backgroundGradient bug?

Hi there,

It seems like that setting the backgroundGradient on a Window could cause the Window to override other elements added to the Window.

This applies to SDK 1.3.2

Reproduce code:

var btnNew = Ti.UI.createButton({title:'Test Button'});

var winNew = Ti.UI.createWindow({
    title: 'Test Window',
    backgroundGradient: {
        type: 'linear',
        colors: [{
            color: '#000',
            position: 0.0
        }, {
            color: '#fff',
            position: 1.0
        }]
    }
});

winNew.add(btnNew);

winNew.open();

After the winNew opened, the button is missing. But actually it's under the gradient layer (zIndex problem?).

Is this a possible bug?

— asked July 7th 2010 by William Xue
  • backgroundgradient
  • iphone
0 Comments

2 Answers

  • Accepted Answer

    This is definitely a bug. I had to deal with the same problem. I worked around it by doing some magic with layered views and not setting gradient on the window object itself.

    — answered July 9th 2010 by Kyle Quest
    permalink
    0 Comments
  • That surely does the trick..

    My intention for setting up the gradient was to replace the need for a background image, which also reduce the size of memory cache.

    Anyway, thanks for your answer.

    Although it's not a big issue at all. Hopefully the team will be able to pick it up on the next release.

    — answered July 10th 2010 by William Xue
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.