uilabel Questions

3

Solved

Setting lineBreakMode to byWordWrapping and set numberOfLines to 0 does not seem to be sufficient: struct MyTextView: UIViewRepresentable { func makeUIView(context: Context) -> UILabel { let ...
Mellott asked 20/10, 2019 at 0:3

13

Solved

I need to create a UILabel with a background color, and I'd like to add some left/right leading/trailing horizontal padding. But every solution I've found seems like a nasty hack. What is the 'stan...
Melatonin asked 17/10, 2013 at 21:24

21

How can I underline a text that could be multiple lines of string? I find some people suggest UIWebView, but it is obviously too heavy a class for just text rendering. My thoughts was to figure ou...
Notum asked 26/4, 2010 at 5:33

3

Solved

I'm getting the width of a UILabel [after the text has been set] with: myUILabel.frame.width but its always the same width, no matter if it holds the String: "Hello." or the String: "Hello ever...
Earleanearleen asked 27/5, 2015 at 12:6

5

I have a UILabel and it is set to 42.0 pt font, and the width of the label is set using autoconstraints based on factors other than the label itself (aka the things to the right and left of the lab...
Nephrosis asked 4/3, 2017 at 3:21

9

Solved

I am currently making an application that uses a custom View Controller container. Multiple views are on the screen at one time and when one is tapped, the selected view controller animates to full...
Mabe asked 24/1, 2013 at 5:26

15

Solved

I know soft shadows are not supported by the UILabel out of the box, on the iPhone. So what would be the best way to implement my own one? EDIT: Obviously I will subclass the UILabel and draw in ...
Pittance asked 10/11, 2009 at 16:13

4

Is there a way i can draw border around every word of UILabel. Suppose UILabel contains the string " This is the Line 1". I want 5 different border around 5 words This Is the Line 1 ...
Orientalism asked 2/12, 2015 at 9:36

1

Solved

I am creating a view that looks like this - I am struggling to align the summary text with the text inside the image overlay. I would like the leading edge of Research to align with the leading...
Cesaro asked 29/5, 2020 at 17:16

8

Solved

At WWDC 2015, there was a session about the new “San Francisco” system font in iOS 9. It uses proportional number rendering instead of monospaced numbers by default when linked against the iOS 9 SD...
Airla asked 15/6, 2015 at 20:46

4

Is there any way in Swift i can change my UILabel's text color property at once in whole app? I've tried using appeareance property but that doesn't work for UILabel textColor. Any way or any libra...
Municipal asked 5/1, 2019 at 11:14

5

Solved

I am a beginner in Swift and I am trying to get the height of a label. The label has multiple lines of text. I want to know the total height it occupies on the screen.
Aphelion asked 8/4, 2016 at 20:38

11

Solved

How can I make a multiline UILabel in interface builder for iOS? I tried the UITextView but it didn't quite suit my needs. How can I add multiline (text) in label?
Semiweekly asked 2/7, 2011 at 14:3

6

Solved

I'm new to iPhone and Mac programming (developed for Windows before), and I've got a question: How do I animate the text property of an UILabel between two numbers, e.g. from 5 to 80 in an Ease-Ou...
Schroer asked 14/3, 2011 at 16:15

17

Solved

Is it possible to use the autoshrink property in conjunction on multiple lines on a UILabel? for example, the large text size possible on 2 available lines.
Ellaelladine asked 30/1, 2012 at 5:12

9

I am developing an iPhone app, and I want to set kerning in UILabel. The code I've written (possibly around kCTKernAttributeName) seems to be in error. How might I approach fixing this? NSMutableA...
Monkhmer asked 10/9, 2011 at 6:20

1

Solved

I am using the following UITapGestureRecognizer that I modified so others could copy and paste to see the same output as me. extension UITapGestureRecognizer { func didTapAttributedTextInLabel(l...
Fredette asked 7/5, 2020 at 6:54

6

Solved

In a simple iPhone app I display a letter tile (custom UIView with an image and 2 labels) by the following code in viewDidLoad: DraggedTile *tile = [[[NSBundle mainBundle] loadNibNamed:@"Dragged...
Bac asked 27/3, 2014 at 13:16

10

Solved

I want to change the spacing between digits in a UIKit UILabel so that it is equal. With standard spacing, the label looks like this: I'd like it to look like this: How can this be achieved...
Avalos asked 7/6, 2016 at 21:35

7

Solved

Suppose I have an AttributedString: "Already have an account? Sign in!". I am placing this String in UILabel. Now when a user clicks on "Sign in!", the current viewController sh...
Solution asked 25/7, 2016 at 10:41

6

Solved

I am creating an app in >=iOS6. And I want to change the character spacing in UILabel. I have added the custom font "FUTURABT HEAVY" in my app but the Character are too close to eachother. I have ...
Caldeira asked 14/12, 2013 at 7:17

5

Solved

I am trying to display numbers on a UILabel with a bold black font and size 50. After some failed attempts I just realized that no matter what color I set the font to, it always gets set to lightG...
Tesch asked 18/8, 2014 at 2:47

4

Solved

I'm trying to implement 6 lines high description label and I want it to be focusable. Ideally that would mean extending UILabel class to make a custom component. I tried that by implementing canBec...
Colour asked 23/11, 2015 at 13:10

7

I would like to display html formatted text on a UILabel in IOS. In Android, it has api like this .setText(Html.fromHtml(somestring)); Set TextView text from html-formatted string resource in XML...
Remanent asked 16/9, 2014 at 23:15

21

Solved

Let see that I have a string look like this: NSString *longStr = @"AAAAA\nBBBBB\nCCCCC"; How do I make it so that the UILabel display the message like this AAAAA BBBBB CCCCC I don't th...
Faulk asked 22/2, 2010 at 17:52

© 2022 - 2024 — McMap. All rights reserved.