Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25379] iOS: Setting "borderColor" wrongly displays a border while "borderWidth" is zero

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.0.2
Fix Version/sn/a
ComponentsiOS
Labelsborder, engSchedule, ios
ReporterJoshua Quick
AssigneeUnknown
Created2017-10-09T22:40:03.000+0000
Updated2019-05-14T15:34:37.000+0000

Description

*Summary:* On iOS, if you first set a view's "borderWidth" to zero and then set "borderColor" afterwards, then the view will display a "1dp" border anyways. The zero border width setting is not respected. Note that the order you set the properties is important. You must set "borderColor" -after- setting "borderWidth". This is not an issue for border widths >= 1. *Test Code:*
var window = Ti.UI.createWindow({ backgroundColor: "black" });
var view = Ti.UI.createView(
{
	width: "50%",
	height: "50%",
	backgroundColor: "blue",
	borderWidth: 0,
});
view.borderColor = "yellow";
window.add(view);
window.open();

Ti.API.info("@@@ borderWidth: " + view.borderWidth);
*Work-Around:* You can work around this issue by setting "borderWidth" after "borderColor" like this.
view.borderColor = "yellow";
view.borderWidth = 1;
view.borderWidth = 0;
*Notes:* The border width must default to 1dp if the "borderWidth" property has not been assigned. This behavior is expected by Titanium developers here: [TIMOB-25374]

Comments

No comments

JSON Source