Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scroll long text inside WKInterfaceLabel?

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?

like image 694
Luke Avatar asked Mar 17 '15 21:03

Luke


2 Answers

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 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.

Hope that helps!

like image 148
cnoon Avatar answered Oct 19 '22 15:10

cnoon


It isn't possible to have a WKInterfaceLabel scroll its contents. Your only choice is to truncate the text or allow the label to grow and accommodate it.

like image 5
bgilham Avatar answered Oct 19 '22 16:10

bgilham