ios - 在 WKInterfaceLabel 中滚动长文本?

标签 ios watchkit apple-watch wkinterfacelabel

简单的问题:如果 WKInterfaceLabel 的文本太长而无法容纳在标签的框架内,是否有办法使它滚动?类似于 UITextView 的东西?

最佳答案

你绝对可以做到这一点。您需要做的就是在 Storyboard 的 WKInterfaceLabel 上设置以下属性。

  • Label => Lines = 0(WatchKit 会设置正确的数字)
  • Size => Width = "Relative to Container"
  • Size => Height = "大小适合内容"

这会让您滚动到您心仪的内容。我只是在一个示例应用程序中对其进行了模拟,它的工作方式与您预期的完全一样。

希望对您有所帮助!

关于ios - 在 WKInterfaceLabel 中滚动长文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29110184/

相关文章:

ios - 如何添加按钮或标签以编程方式观看

ios - 多个数据模型的多个 ObjectContext?

ios - Swift - 基于时间的 UUID - 如何对它们进行排序

ios - 在 iOS 中旋转一条简单的线

ios - 如何在xcode 4.5.1上将iOS部署目标更改为4.2?

ios - 将数据从 iOS 查询传递到 Watch

ios - 如何从 WatchKit Extension 调用 CoreData 代理框架?

ios - 未调用handleWatchKitExtensionRequest 的问题?

watchkit - 访问 Apple Watch 的麦克风

appdelegate - Apple Watch 应用程序的应用程序委托(delegate)文件相当于什么?