Nested opacity
I have a view which has opacity 0.5 applied for a background effect, but in there are two labels with text which should NOT want to inherit the opacity (value should be 1).
Is there a way to achieve this or do nested elements automatically receive their parents' opacity properties without the option over overriding?
Thanks
3 Answers
-
I had a problem with background opacity (In my case I wanted to disable the buttons behind a view), I ended with a background image png slightly transparent to look like the opacity effect. This way in your case I think you could keep your labels at opacity 1.
Good Luck ;)
-
You'd need to override the opacity if you don't want it inherited.
-
Hmmm Bizarre I do overwrite it:
var textContainer = Ti.UI.createView({
width: 200,
height:'auto',
backgroundColor: '#000',
opacity: 0.5,
right: 0
});textContainer.add(Ti.UI.createLabel({
text: 'My text in this label',
color: '#FFF',
height:'auto',
opacity: 1,
font: {fontSize:20, fontFamily: 'Georgia'},
top: 10,
left: 10
}));Am I doing something wrong? Or is clem clem's solution the only way out here?
Thanks!