Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15025] iOS7: hintText becomes invisible on dark background

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2013-10-04T17:07:29.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 18, 2013 Sprint 20, 2013 Sprint 20 API
ComponentsiOS
Labelsipass1, triage
ReporterDavide Cassenti
AssigneeIngo Muschenetz
Created2013-09-02T17:15:18.000+0000
Updated2017-03-28T20:25:12.000+0000

Description

Problem description

When a dark background is used, the hint text does not show up in a text field.

Code to reproduce

var win = Ti.UI.createWindow({
	backgroundColor : "black"
});

var text = Ti.UI.createTextField({
	width : 280,
	height : 60,
	top : 50,
	left : 20,
	color : "blue",
	font : {
		fontSize : 30,
	},
	backgroundColor : 'transparent',
	hintText : "HINT TEXT"
});
win.add(text);
win.open();

Notes

Change the window background color to 'white' and the hintText will be visible in gray color. Same error happens changing the backgroundColor of the text field.

Attachments

FileDateSize
iOS Simulator Screen shot 3 Sep 2013 17.58.04.png2013-09-03T16:59:24.000+000011044

Comments

  1. Davide Cassenti 2013-09-03

    Tested with today's 3.1.3 and latest Xcode. The sample shows a total black window. See screenshot (yes, it is total black). The hint text is invisible, but you can click on the text field and write inside.
  2. Vishal Duggal 2013-09-04

    Resolving this as not our bug. Apple has changed the color of the hint text label on IOS7 so it is now closer to black (hence almost invisible) On older versions of IOS the hintTextColor is UIDeviceWhiteColorSpace 0.7 1 (gray with 70% opacity). On IOS7 it is UIDeviceRGBColorSpace 0 0 0.0980392 0.22 (Read RGBA. Alpha 0.22). Can't fix this since we have no API's to change this labels properties.
  3. Vishal Duggal 2013-09-12

    We do not call internal API's in our SDK. Two reasons 1. The app might be rejected 2. The solution may stop working at any time.
  4. Dan Tamas 2013-09-19

    What about something like this? ~~~ [[UILabel appearanceWhenContainedIn:[UITextField class], nil] setTextColor:[UIColor yellowColor]]; ~~~ and of course to be able to pass a *hintColor* param for the setTextColor ?
  5. Vishal Duggal 2013-10-04

    Marking this as invalid. TIMOB-14235 will provide the ability to set an attributed string for hintText.
  6. Eric Merriman 2017-03-28

    Closing

JSON Source