Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24203] iOS: TextField ignores backgroundColor when borderStyle set

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-12-13T10:27:06.000+0000
Affected Version/sRelease 6.0.0, Release 5.4.0, Release 5.5.1
Fix Version/sRelease 6.1.0
ComponentsiOS
Labelsios, qe-6.1.0
ReporterBaharroth
AssigneeHans Knöchel
Created2016-12-09T13:34:56.000+0000
Updated2016-12-13T18:00:46.000+0000

Description

When you use the borderStyle property on IOS on a textfield, the SDK wrap your textfield in a view. The parent view keep the backgroundColor of the original textfield but the child has a white backgroundcolor. The parent should use a backgroundColor transparent and the child the backgroundcolor of the orignal textfield
".container": {
	backgroundColor: "red"
}

"TextField": {
	borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
	width: 200,
	height: 100,
	backgroundColor: 'green'
}

<Alloy>
	<Window class="container">
		<TextField></TextField> 
	</Window>
</Alloy>

Attachments

FileDateSize
Simulator Screen Shot 9 déc. 2016 14.29.39.png2016-12-09T13:33:28.000+000024493

Comments

  1. Rene Pot 2016-12-09

    Just tested this myself. Removing borderStyle lets the backgroundColor work again. Tested also in 5.4.0.GA for good measure, it was broken there too
  2. Hans Knöchel 2016-12-09

    Problem: The background-color was applied to the wrong view layer (behind the real UITextField). Fixed that. PR: https://github.com/appcelerator/titanium_mobile/pull/8671 Test-Case:
       var win = Ti.UI.createWindow({
           backgroundColor: '#fff'
       });
       
       var field = Ti.UI.createTextField({
           borderStyle: Titanium.UI.INPUT_BORDERSTYLE_ROUNDED,
       	width: 200,
       	height: 100,
       	backgroundColor: 'green'
       });
       
       win.add(field);
       win.open();
       
  3. Josh Longton 2016-12-13

    Verified as fixed, the text field now uses backgroundColor when borderStyle is also set. Tested on: {noformat} macOS Sierra 10.12.1 iPhone 6 (10.0) iOS Simulator (9.1, 10.1) Xcode 8.1 Ti SDK: 6.1.0.v20161213022709 Appc NPM: 4.2.8 App CLI: 6.1.0-319 Node v4.6.0 {noformat} *Closing Ticket.*

JSON Source