在 WKInterfaceLabel 内滚动长文本? [英] Scroll long text inside WKInterfaceLabel?

查看:28
本文介绍了在 WKInterfaceLabel 内滚动长文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Simple question: is there a way to make a WKInterfaceLabel scroll if its text is too long to fit within the label’s frame? Something akin to a UITextView?

推荐答案

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

You can definitely do this. All you need to do is set the following properties on the WKInterfaceLabel in the Storyboard.

  • Label => Lines = 0(WatchKit 会设置正确的数字)
  • 尺寸 => 宽度 =相对于容器"
  • 尺寸 => 高度 =适合内容的尺寸"
  • Label => Lines = 0 (WatchKit will set the right number)
  • Size => Width = "Relative to Container"
  • Size => Height = "Size to Fit Content"

这将让您滚动到您想要的内容.我只是在一个示例应用中模拟了它,它的工作原理与您预期的完全一样.

This will let you scroll to your heart's content. I just mocked it up in a sample app and it works exactly as you would expect.

希望有帮助!

这篇关于在 WKInterfaceLabel 内滚动长文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆