ios - 使用 XIB 在 UITextView 上设置内容插入

标签 ios swift interface-builder uiedgeinsets

我有一个 UITableViewCell,其中包含一个 UITextView

我想在此 TextView 上设置内边距,以便单元格内容在每一侧被插入 10。

我知道我可以在代码中使用 textView.textContainerInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)

在处理 XIB 文件时是否可以使用 IB?

最佳答案

您可以使用 Rect 类型设置 Key Path

这应该可以达到您的要求。

enter image description here

关于ios - 使用 XIB 在 UITextView 上设置内容插入,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54087807/

相关文章:

ios - SwiftUI在watchOS上通过NavigationLink列出性能下降

objective-c - 项目中所有 IBOutlet、IBAction 连接的总结?

swift - Xcode 12 Interface Builder 显示 “No selection”

ios - 为什么在 Xcode 7.2.1 中创建项目存档时出现此链接器错误

cocoa-touch - 关闭模态视图 Controller 后重新加载 gridView 数据时出现问题

ios - 无法在 Xcode 8.3.2 中为 iOS 应用签署证书

ios - Xcode 无法识别 Timer() - Swift 3

iOS Swift NSLayoutConstraint。无法设置水平居中 View

ios - UITableViewCell 内容 View 不填充单元格

ios - 突然 fcm 通知在某些 iOS 设备上不起作用