Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16054] iOS: Titanium Label shows up as Blended Layer in iOS simulator

GitHub Issuen/a
TypeBug
Priorityn/a
StatusReopened
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsios, reprod
ReporterLars Andersson
AssigneeUnknown
Created2013-09-09T23:15:00.000+0000
Updated2018-02-28T20:03:28.000+0000

Description

When using the debug option in the iPhone simulator I found that (all) my Titanium Labels show up as Color Blended Layers, even though I set the backgroundColor and explicitly set the opacity to 1.
var pageView = Ti.UI.createView({
    width: Ti.UI.FILL,
    height: Ti.UI.FILL,
    backgroundColor: '#FFFFFF'
});

    var text = Ti.UI.createLabel({
        width: Ti.UI.FILL,
        height: Ti.UI.SIZE,
        top: 100,
        left: 49,
        right: 10,
        textAlign: "left",
        text: "some text",
        opacity: 1,
        backgroundColor: '#FFFFFF'
    });
    pageView.add(text);

Comments

  1. Mostafizur Rahman 2013-09-18

    Hello, Can you post test code and test case for this issue that we can reproduce? Thanks
  2. Lars Andersson 2013-09-18

    It is easy to reproduce - just create a new Alloy based project in Studio (no need to edit anything) and run in iPhone or iPad Simulator. Under the Debug menu in the Simulator enable "Color Blended Layers" and you will see the "Hello World" label be colored in red (a blended layer). All labels in all apps will be the same. Apple recommends that an app should not have any blended layers if max performance is a priority, with labels we do not seem to have a choice.
  3. Vincent 2013-10-03

    setting backgroundColor and opacity to 1 is not enough. we need access to the OPAQUE property for UILabel (at least) which is set to NO by default in this case (need to be confirmed). I saw the same problem with custom Cell Layout having UILabel. Blended Layers could be a problem in scrollView. an exemple of Color Blended Layers Impact: http://blogs.captechconsulting.com/blog/john-szumski/performance-tuning-older-ios-devices Shall I open another ticket ?
  4. Lars Andersson 2013-10-03

    I asked the question on Stack Overflow and I got an answer that a Label is a TiView containing a UILabel with a clear background. TiUILabel.m line 147: label.backgroundColor = [UIColor clearColor];
  5. Lars Andersson 2013-10-03

    Not sure why Mostafizur Rahman set this ticket as Resolved when it is not. Maybe it is best to open a new ticket and refer to this one.
  6. Vincent 2013-10-04

    a starting point: I have implemented a setBackgroundColor_: in TiUILabel.m test case : in app.js: create a label with a backgroundColor property. create a label without a backgroundColor property. and check with the simulator. result: there is no Blended Layer for the Label with a backgroundColor property. implementation in TiUILabel.m:
       
       
       -(void)setBackgroundColor_:(id)color
       {
       	if ([color isKindOfClass:[UIColor class]])
       	{
               [self label].backgroundColor = color;
       		super.backgroundColor = color;
       	}
       	else
       	{
       		//TiColor *ticolor = [TiUtils colorValue:color];
               UIColor * aColor =[[TiUtils colorValue:color] _color];
               
               [self label].backgroundColor = aColor;
       		super.backgroundColor = aColor;
       	}
       }
       
       
       
  7. Mostafizur Rahman 2013-10-11

    Hello, We have not heard back from you since our last update. Please let me know if the issue has been resolved and if this issue can be closed. However, you can reopen the ticket when you need. Thanks
  8. Mostafizur Rahman 2013-12-14

    Moving this to engineering as we can reproduce the problem with 3.1.3 GA SDK.

    Testing Environment

    OS: MAC OX X 10.8.5 iOS SDK: 7.0,Xcode 5 iOS Simulator: 7.0 Ti SDK: 3.1.3 GA

    Test Code

       var win = Ti.UI.createWindow({
       	layout : 'vertical',
       	backgroundColor : '#fff'
       });
       var pageView = Ti.UI.createView({
       	width : Ti.UI.FILL,
       	height : Ti.UI.FILL,
       	backgroundColor : '#FFFFFF'
       });
       
       var text = Ti.UI.createLabel({
       	width : Ti.UI.FILL,
       	height : Ti.UI.SIZE,
       	top : 100,
       	left : 49,
       	right : 10,
       	textAlign : "left",
       	text : "some text",
       	opacity : 1,
       	backgroundColor : '#FFFFFF'
       });
       pageView.add(text);
       
       win.add(pageView);
       win.open();
       
       

    Step to reproduce

    Create new Titanium project

    Update app.js file with above code

    Run on IOS simulator

    Activate Color Blended Layers (Under the Debug menu in the Simulator enable "Color Blended Layers")

    All labels in this app will be red color

  9. Lee Morris 2017-07-10

    I am able to reproduce this issue with the following environment; iPhone 6 Simulator (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source