[TIMOB-25754] iOS: setting viewShadowColor on Button causes it to ignore borderRadius property
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Brian García |
Assignee | Jan Vennemann |
Created | 2018-01-26T10:37:32.000+0000 |
Updated | 2020-10-07T17:21:06.000+0000 |
Description
setting viewShadowColor on Button causes it to ignore borderRadius property.
testCase:
var win = Titanium.UI.createWindow();
var btn = Titanium.UI.createButton({
viewShadowColor: '#992E2E2E',
viewShadowOffset: {
x: 0,
y: 3
},
viewShadowRadius: 3,
borderRadius:20,
width:200,
height:40,
title:"test"
});
win.add(btn);
win.open();
Attachments
File | Date | Size |
---|---|---|
Captura de pantalla 2018-01-26 a las 11.33.33.png | 2018-01-26T10:34:37.000+0000 | 9307 |
Captura de pantalla 2018-01-26 a las 11.34.17.png | 2018-01-26T10:34:27.000+0000 | 8230 |
Did this work in earlier versions of the SDK? Also, it seems to work for me unless I set a background-color:
Just tested with the following SDK: ||SDK||borderRadius applied to shadow||borderRadius applied to button|| |6.1.2.GA|true|false| |6.2.0.GA|true|false| |6.2.2.GA|true|false| |6.3.0.GA|true|false| |7.0.0.GA|true|false| Just remember that could be related with this issue: [ImageView shadow](https://github.com/AndreaVitale/av.imageview/issues/24)
Hello, I tested the issue on previous version 7.0.0.GA, 6.3.0.GA, 6.2.2.Ga, I can see the border-radius does work with viewShadowColor. Also, as [~hknoechel], said with background-color this does not. So, the issue is with the background color. With background color, border-radius does not work, but viewShadowColor does. Thanks.
Any update on this?
Any update on this? Such a strange glitch..
Would be great to see in 8.0.0! I'll also try to hack on this.
It seems to be related to clashing view-layer properties and clipping / masking. [This](https://stackoverflow.com/a/25475536/5537752) should work, but I wasn't able to apply it to the SDK structure so far. Any help is appreciated.
Quick workaround: Create a view with a label instead of a button and / or place the button inside the shadowed view.
Any news on this?
[~bgarcia] It should work in 9.2.0 with a minor change (Update
to
). Reason is in case of multiple value of border radius, we use UIBezierPath and CAShapeLayer to create add corner radius. See following updated test case -
Same problem, confirm that the '20 20' solution works but sometimes render strangely with shadow over button
I can confirm what Pietro reported. with the "20 20" the shadow works nice until you hide the button, in that case the shadow remains in screen and, in my case, it has a strange animation. I can share a video showcasing the issue in private