ios-UITextView-可以和UITextField一样设置placeholder,支持autolayout布局,可以限制字数。.zip

时间:2022-07-31 12:15:42
【文件属性】:
文件名称:ios-UITextView-可以和UITextField一样设置placeholder,支持autolayout布局,可以限制字数。.zip
文件大小:69KB
文件格式:ZIP
更新时间:2022-07-31 12:15:42
文字视图 简单使用: PlaceholderTextView *textView = [[PlaceholderTextView alloc]init]; textView.placeholderLabel.font = [UIFont systemFontOfSize:15]; textView.placeholder = @"请输入文字..."; textView.font = [UIFont systemFontOfSize:15]; textView.frame = (CGRect){10,80,CGRectGetWidth(self.view.frame)-20,100}; textView.maxLength = 200; textView.layer.cornerRadius = 5.f; textView.layer.borderColor = [[UIColor grayColor]colorWithAlphaComponent:0.3].CGColor; textView.layer.borderWidth = 0.5f; [self.view addSubview:textView]; [textView didChangeText:^(PlaceholderTextView *textView) { NSLog(@"%@",textView.text); }];
【文件预览】:
PlaceholderTextView
----PlaceholderTextViewUITests()
--------PlaceholderTextViewUITests.m(1KB)
--------Info.plist(680B)
----.git()
--------index(3KB)
--------hooks()
--------config(137B)
--------description(73B)
--------refs()
--------logs()
--------objects()
--------info()
--------COMMIT_EDITMSG(15B)
--------HEAD(23B)
----.DS_Store(6KB)
----PlaceholderTextView.xcodeproj()
--------project.xcworkspace()
--------project.pbxproj(22KB)
--------xcuserdata()
----PlaceholderTextView()
--------Assets.xcassets()
--------main.m(342B)
--------AppDelegate.h(285B)
--------AppDelegate.m(2KB)
--------Base.lproj()
--------PlaceholderTextView.h(690B)
--------ViewController.h(223B)
--------Info.plist(1KB)
--------ViewController.m(1KB)
--------PlaceholderTextView.m(5KB)
----PlaceholderTextViewTests()
--------PlaceholderTextViewTests.m(943B)
--------Info.plist(680B)

网友评论