[TIMOB-16054] iOS: Titanium Label shows up as Blended Layer in iOS simulator
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Reopened |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | ios, reprod |
Reporter | Lars Andersson |
Assignee | Unknown |
Created | 2013-09-09T23:15:00.000+0000 |
Updated | 2018-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);
Hello, Can you post test code and test case for this issue that we can reproduce? Thanks
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.
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 ?
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];
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.
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:
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
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 GATest Code
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
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