Created
November 3, 2017 07:59
-
-
Save wuchuwuyou/aff2ada2041cd3adf7f5b5c30430f683 to your computer and use it in GitHub Desktop.
UITextView placeHolder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UILabel *placeHolderLabel = [[UILabel alloc] init]; | |
placeHolderLabel.text = LDLocalizedString(@"xxxxxxxxx"); | |
placeHolderLabel.numberOfLines = 0; | |
placeHolderLabel.textColor = [UIColor lightGrayColor]; | |
[placeHolderLabel sizeToFit]; | |
[self.userTextView addSubview:placeHolderLabel]; | |
// same font | |
placeHolderLabel.font = self.userTextView.font; | |
[self.userTextView setValue:placeHolderLabel forKey:@"_placeholderLabel"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment