FLTextView 1.0.2

FLTextView 1.0.2

测试已测试
语言语言 SwiftSwift
许可证 MIT许可证
发布最后发布2015年5月
SPM支持SPM

Danilo BürgerFreeletics 维护。



  • Danilo Bürger

FLTextView 向 UITextView 添加占位符,就像 UITextField 原生提供的那样。与其他类似库相比,我们允许根据占位符的大小调整塗鴉視窗(UITextView)区域的高度或内容大小。

需求

  • iOS 7.0+
  • Xcode 6.1

如何开始

下载 FLTextView 并尝试 iPhone 示例应用程序。

通讯

  • 如果您 需要帮助,请创建一个问题。
  • 如果您 发现错误,请创建一个问题。
  • 如果您 有功能请求,请创建一个问题。
  • 如果您 想要贡献,请提交一个请求。

部署目标:iOS 7.0+

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '7.0'

pod 'FLTextView/Legacy', '~> 1.0'

CocoaPods 仅支持 iOS 8.0+ 部署目标的 Swift 代码文件。这就是为什么在您安装了库之后,您必须手动将文件夹 Pods/FLTextView/FLTextView 作为组包含在 Xcode 项目中。

部署目标:iOS 8.0+

source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '8.0'
use_frameworks!

pod 'FLTextView', '~> 1.0'

编辑 Podfile 后,请运行以下命令:

$ pod install

使用方法

您可以通过 Interface Builder 配置 FLTextView(请参阅示例),或使用如下方法:

let textView = FLTextView(frame: CGRectZero, textContainer: nil)
textView.placeholder = "ClapClap"
textView.placeholderTextColor = UIColor.lightGrayColor()

也支持属性文本

let placeholder = NSMutableAttributedString(string: "No excuses")
placeholder.addAttribute(NSForegroundColorAttributeName, value: UIColor(white: 0.7, alpha: 1.0), range: NSMakeRange(0, 10))
placeholder.addAttribute(NSStrikethroughStyleAttributeName, value: NSUnderlineStyle.StyleDouble.rawValue, range: NSMakeRange(3, 7))
placeholder.addAttribute(NSUnderlineStyleAttributeName, value: NSUnderlineStyle.StyleSingle.rawValue, range: NSMakeRange(0, 2))

textView.attributedPlaceholder = placeholder

许可证

FLTextView 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。