Questions tagged [wkinterfacelabel]

In iOS Watchkit, a WKInterfaceLabel object lets you manipulate the contents of an onscreen label at runtime. Use a label object to set a new text string for the label.

A WKInterfaceLabel object lets you manipulate the contents of an onscreen label at runtime. Use a label object to set a new text string for the label. The string you specify can use the default styling you specified at design time, or you can use an attributed string to add custom styling to the text.

Do not subclass or create instances of this class yourself. Instead, define outlets in your interface controller class and connect them to the corresponding objects in your storyboard file. For example, to refer to a label object in your interface, define a property with the following syntax in your interface controller class:

SWIFT

@IBOutlet weak var myLabel: WKInterfaceLabel!

OBJECTIVE-C

@property (weak, nonatomic) IBOutlet WKInterfaceLabel* myLabel;

Apple Documentation

40 questions
16
votes
0 answers

How do you support Dynamic Type changes in a WKInterfaceLabel?

I have a WKInterfaceLabel in an Apple Watch app running watchOS 5. I have set its attributed string to one that contains a bold font attribute applied to a substring. The boldface shows correctly when the app is run. However, if you change the…
leftspin
  • 2,468
  • 1
  • 25
  • 40
12
votes
2 answers

WatchKit adding margin to Label

Is there a way to add a margin / padding to a WKInterfaceLabel in Watchkit? Using UIEdgeInsets doesn't work.
Franlon
  • 147
  • 6
11
votes
2 answers

How to change font size of label Apple Watch

I'm kind of stunned I even have to ask this question, but how is it possible to change the size of a label's text on the Apple watch? It doesn't allow changing the size in the Xcode UI, I haven't been able to do it programmatically, and the…
123
  • 8,733
  • 14
  • 57
  • 99
10
votes
8 answers

WatchKit Extension[4608:145616] Unable to find image named "hello" on Watch

Problem: Trying to set the WKInterfaceLabel text using xCode 6.2 but it returns this error: WatchKit Extension[4608:145616] Unable to find image named "hello" on Watch Code: @IBOutlet var lblPassword:…
user1872384
  • 6,886
  • 11
  • 61
  • 103
8
votes
4 answers

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?
Luke
  • 9,512
  • 15
  • 82
  • 146
7
votes
2 answers

Animate WKInterfaceLabel with text change apple watch swift

I am working on an apple watch application. In the application, I have a view where the user may swipe left and right between 3 given results. I am using WKInterfaceLabel to show result information. On each swipe, labels are updated with new…
Akshay Sunderwani
  • 12,428
  • 8
  • 29
  • 52
5
votes
2 answers

How does WKInterfaceLabel Min Scale work? It gets ignored once set values

I'm setting up a WKInterfaceController like this: (read RTC as Relative to Container, AL as alignment and STF as size to fit content) - Main Group: w: RTC (1) h: RTC (1) - AL h: Center v: Top - WKInterfaceImage w: 30 h: 30 - AL h: Center v: Top …
dev_mush
  • 2,136
  • 3
  • 22
  • 38
5
votes
1 answer

WatchKit WKInterfaceGroup, one label on top of another?

Simple question: is it possible to stack one WKInterfaceLabel on top of another inside a WKInterfaceGroup? I’m dragging like a mad man and I cannot get the blue target line to setting above or below the first label. It’ll sit beside it, to its left…
Luke
  • 9,512
  • 15
  • 82
  • 146
4
votes
1 answer

How to set alignment for WKInterface Label using setAttributedText

I'm trying to set alignment for WKInterfaceLabel using setAttributedText function. Here is my code: var paragraphStyle = NSParagraphStyle.defaultParagraphStyle() paragraphStyle.alignment = NSTextAlignment.Center var attributedDictonary =…
3
votes
0 answers

Increase WKInterfaceLabel font size if space is available

I have a screen in my watch app that just contains 1 WKInterfaceLabel, set to 0 lines. It's width and height are set to "Size to Fit Content". I want all the text to fit on one screen, without any scrolling. At runtime, I need to be able to reduce…
djibouti33
  • 12,102
  • 9
  • 83
  • 116
3
votes
1 answer

WatchOS2 - Is there any way to scroll a label horizontally?

I am wondering (hoping) that there is a way to scroll a WKInterfaceLabel horizontally?
ICL1901
  • 7,632
  • 14
  • 90
  • 138
3
votes
3 answers

iWatch: WKInterfaceLabel is it possible to stop text from being cut off with "..." at the end of a label?

The text in my WKInterfaceLabel is way too long and causes the text to be cut off with dots at the end. I know for UILabel for iOS you can easily resolve this issue by enabling clip mode. I don't believe there is any way for me to resolve this for…
William Alex
  • 385
  • 1
  • 3
  • 14
2
votes
1 answer

Apple Watch: how to align two labels at baseline with different font sizes?

On an apple watch, how do I align two labels at baseline with different font sizes? look at the red and blue labels, they are not aligned at baseline. This is the structure of the first image in the interface builder: horizontal group label…
2
votes
1 answer

How to use alternate font weights (e.g. "short") in a WKInterfaceLabel?

In Apple's Apple Watch Design Resources, there is a document called Alternate Font Weights and Italicizations. In it, it shows examples of what the default font looks like with different attributes such as Italic, Emphasized, and Short applied to…
Senseful
  • 86,719
  • 67
  • 308
  • 465
1
vote
1 answer

Position an image and two labels in a WKInterfaceTable row

I'm building a watch kit extension for my app that includes a WKInterfaceTable. Now I'd like to add a detailTextLabel to the row and place it under the main label. I don't know why but I can only drag it next to the main label not under the primary…
1
2 3