Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text field color #96

Closed
RazvanCosmeanu opened this issue Dec 4, 2017 · 2 comments
Closed

Text field color #96

RazvanCosmeanu opened this issue Dec 4, 2017 · 2 comments

Comments

@RazvanCosmeanu
Copy link

Hello, and thank you for this library. I managed to customize everything how I want, but I have a question. Is it possible to change the text field color? If I set the tokenView.backgroundColor property to black, the text is not visible anymore as I write it. Thanks! Also tokenView.style = KSTokenViewStyle.squared doesn't work as intended, as I still get the rounded corners.

@khawars
Copy link
Owner

khawars commented Dec 4, 2017

You can use tokenTextColor to set text color. Also setting style as squared works fine for me.
Please check Programmatically working example for both of these issues.

@khawars khawars closed this as completed Dec 4, 2017
@RazvanCosmeanu
Copy link
Author

RazvanCosmeanu commented Dec 5, 2017

Thanks for the reply! I was talking about the UITextField textColor, not the token color, as stated in the title.

You are setting it as black in the _commonSetup() init function.

fileprivate func _commonSetup() {
      backgroundColor = UIColor.clear
      clipsToBounds = true
      _tokenField = KSTokenField(frame: CGRect(x: 0, y: 0, width: self.bounds.width, height: self.bounds.height))
      _tokenField.textColor = UIColor.black
     ............
}

But there is no get/set for it exposed in KSTokenView, and the _tokenField is private, so not customizable. Please mark it as an enhancement proposal, but I don't think it should be closed.

*EDIT: Wanted to make a pull request, but there seems to be one already, here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants