Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20047] Parity: iOS support for hintTextColor

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2016-07-27T16:48:47.000+0000
Affected Version/sRelease 5.1.0
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsqe-5.4.0, regression
ReporterFokke Zandbergen
AssigneeHans Knöchel
Created2015-11-23T15:03:49.000+0000
Updated2016-08-01T11:27:12.000+0000

Description

I know TIMOB-5186 was resolved by adding attributedHintText but I still think it would be good to have parity with hintTextColor on Android so this common use case is simpler to implement.

Comments

  1. Hans Knöchel 2016-02-04

    Not agreeing completely, here. Android used a color value for the hintTextColor property. iOS expects an Ti.UI.AttributedString for the attributedHintText property. So either we deprecate hintTextColor on Android and introduce the attributedHintText property, or we leave it like it is. What do you think [~fokkezb]?
  2. Fokke Zandbergen 2016-02-05

    From a developer experience perspective I still prefer to have hintTextColor for iOS as we have with Android. The attributedHintText is a lot more work, in particular if you need to change the text. http://stackoverflow.com/a/21074761/4626813
  3. Hans Knöchel 2016-05-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/7999
  4. Harry Bryant 2016-06-09

    Verified as fixed, iOS now supports hintTextColor. Tested On: iPhone 6S (9.3.2) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160608165242 Appc Studio: 4.6.0.201605201934 Appc NPM: 4.2.7-2 App CLI: 5.4.0-15 Xcode 7.3 Node v4.2.6 *Closing ticket.*
  5. Michael Gangolf 2016-07-26

    My app is crashing with
       message = "-[NSNull length]: unrecognized selector sent to instance 0x10bc3cd80";
       
    when I set my TSS to:
       "TextField" : {
       	font: Alloy.CFG.font.regular,
       	hintTextColor: Alloy.CFG.color.lightgrey,
       	color: Alloy.CFG.color.darkgrey,
       	height:40,
       	backgroundColor: "transparent"
       }
       
    removing the hintTextColor and the crash is gone. tested with SDK: 5.4.0.v20160720201924 It's working fine in 5.3.1.GA (hintTextColor for iOS not available)
  6. Hans Knöchel 2016-07-26

    Valid issue! The API breaks, if you do not specify a hintText, but a hintTextColor, since the latter depends on the former one. PR (master): https://github.com/appcelerator/titanium_mobile/pull/8156 PR (5_4_X): https://github.com/appcelerator/titanium_mobile/pull/8157 Also fixing a case where the hintText is changed afterwards and haven't been applied to the hintTextColor.
  7. Harry Bryant 2016-07-27

    Verified as fixed, I was able to reproduce the error by removing the hintText property with an earlier 5.4.X build. With the latest build the app no longer crashes. Also verified the case in which hintText is changed and hintTextColor is not applied. Tested On: iPhone 6S (9.3.2) Device & iPhone 6 Plus (8.3) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160727094731 Appc Studio: 4.7.0.201607111053 Appc NPM: 4.2.7 App CLI: 5.4.0-34 Xcode 7.3 Node v4.4.7 *Closing ticket.*
  8. Michael Gangolf 2016-08-01

    There seems to be another issue in relation with alloy, hintTextColor and an int hintText! while this is working fine now:
       var win = Ti.UI.createWindow({
           backgroundColor:"#fff"
       });
       var tf = Ti.UI.createTextField({
           hintText: "123",
           hintTextColor: "red",
           borderWidth:1,
           borderColor:"#000",
           width:40
       });
       win.add(tf);
       win.open();
       
    There is a problem with an alloy hintText, that contains only an int value:
       $.index.open();
       
       <Alloy>
       	<Window>
       		<TextField id="tf_name" hintText="33"/>
       	</Window>
       </Alloy>
       
       "#tf_name": {
       	hintTextColor: "red"
       }
       
    It works when you either remove the hintTextColor, remove the hintText or add a character into the hintText. Setting the hintText to "123" in the non-alloy example works fine, too!
  9. Hans Knöchel 2016-08-01

    [~michael] Thanks! That case is fixed in: master: https://github.com/appcelerator/titanium_mobile/pull/8183 5_4_X: https://github.com/appcelerator/titanium_mobile/pull/8184
  10. Michael Gangolf 2016-08-01

    fix is working fine now with a number only hintText! Thanks for the quick PR

JSON Source