-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Problem with TextView ( add placeholder to TextView in Editor component ). #598
Comments
Hey, So in Material 2, I silently launched a new component that is officially launched at the end of the month. It is called let editor = Editor()
editor.textViewEdgeInsetsPreset = .square4
editor.textView.font = RobotoFont.regular
view.layout(editor).edges() Place that code in a UIViewController and see what happens. You could also hook delegation methods and a new enum for tapping into character attributes. For example: extension ViewController: EditorDelegate {
@objc
fileprivate func editor(editor: Editor, willProcessEditing textStorage: TextStorage, text: String, range: NSRange) {
textStorage.updateAttributes(characterAttributes: [.font: RobotoFont.regular, .forgroundColor: Color.black], range: range)
}
@objc
fileprivate func editor(editor: Editor, didProcessEditing textStorage: TextStorage, text: String, range: NSRange) {
textStorage.updateAttributes(characterAttributes: [.font: RobotoFont.bold, .forgroundColor: Color.blue.base], range: range)
print(editor.uniqueMatches)
}
} Let me know how it goes. Also, I made an issue Samples Editor Issue that we can use to get you up to speed with a sample project :) |
Thanks, I'm trying to implement Editor now. I'll let you know how it goes. |
I have Editor working now, but I still need the placeholder text. Can I do a workaround until you release the full version? Or is the full version coming really soon? |
@theolof Its coming really soon :) When is the latest you need it by? |
Well, we are ready to release the next version except for some color changes and this. Thinking of changing to TextField in the meantime. |
Okay, I will do my best to have it done really soon. It is one of the final parts to releasing the |
I am a few hours from being done the TextView will placeholder and simplified interface. I will push a release by tomorrow. Thank you! |
Hey, please find your feature request in Material 2.6.0 and a sample TextView project. Thank you and all the best! |
I used this code before:
var textView: TextView! /// A Text storage object that monitors the changes within the textView. lazy var text: Text = Text()
I did a pod update and now I cannot compile. "Use of undeclared type 'Text'".
Need help :-)
The text was updated successfully, but these errors were encountered: