uilabel Questions

4

I have a circumstance in my app whereby a label may be given a font size greater than it's height. This is to do with some rather complex architecture and layout code. Normally I would increase the...
Gramme asked 18/10, 2017 at 8:43

4

Solved

Going through some basic improvements to a application I am working on. Still new to the iOS swift development scene. I figured that the lines of text in my code would automatically be centered bec...
Swimming asked 30/10, 2015 at 18:52

7

Solved

I want to add the gradient as a background to label. I used the following code to acheive that. but the problem is that though the gradient color appears on the label, but the text is not visible. ...
Circumference asked 31/1, 2011 at 11:7

2

I am setting the attributed text of a label, and I am getting this strange error: Terminating app due to uncaught exception 'NSRangeException', reason: 'NSMutableRLEArray replaceObjectsInRange:wit...
Frankie asked 23/8, 2013 at 19:55

6

Solved

I would like to do a drop cap first character in a UILabel using the attributedText NSAttributedString property only. Like this: (source: interpretationbydesign.com) I have experimented with adjus...
Appalachian asked 8/1, 2013 at 12:24

2

I have an attributed string as below to be displayed in a label. let someText = NSMutableAttributedString(string: "This is a sample text with") let imageAttachment = NSTextAttachment() imageAttach...
Veal asked 28/1, 2020 at 5:57

3

Solved

I'm working with a designer and we have a few different typefaces involved in the project, sometimes doing everything in all caps, sometimes all lower case. This applies to both my labels and butto...
Fecundate asked 15/6, 2018 at 4:27

4

Solved

I add a UITapGestureRecognizer:tapGesture, I want that when I click(touch) the label, klikPlay() will run its actions. when I run the code and click/touch the label, it gives this error: unrec...
Anticipation asked 21/11, 2014 at 15:24

2

Solved

I want to style a text using NSAttributedString. The text should have a background and a custom padding, so that the text has a little bit of space to the background's edge. This is what I want to...
Petrarch asked 1/8, 2019 at 9:7

38

Solved

I have a UILabel where I want to add space in the top and in the bottom. With the minimum height in constraints, I've modified it to: To do this I've used: override func drawTextInRect(rect: CGRec...
Admixture asked 13/12, 2014 at 14:14

7

Under certain circumstances, UILabel seems to bring an extra word to new line even when there is enough space for it, for example, If one more word is appended, Even if I force the width of t...
Sciomancy asked 23/2, 2018 at 2:4

4

Solved

My issue is with a UILabel. The text it holds is much longer than the actual width of the UILabel. So I would like it to appear with "..." (an ellipsis) at the end to denote that there's ...
Cosmetic asked 7/5, 2016 at 16:40

13

Solved

I have a label which has few lines of text and I want to increase the spacing between the lines. There are similar questions asked by others but the solutions don't solve my problems. Also my label...
Photofluorography asked 26/8, 2016 at 5:4

6

Solved

I have a UILabel, his text size has the property title.adjustsFontSizeToFitWidth = YES; that prevents me from using standard methods to resize the UILabel. I read on another post here that I'm s...
Aboral asked 30/8, 2011 at 11:44

13

Solved

How the UILabel can be aligned from bottom. Let say, my label can hold three line of text.If the input text is single line, then this line should come bottom of the label.Please refer the below ima...
Mccarron asked 15/8, 2013 at 7:15

12

Solved

Is it possible to format the text in a UILabel to show a bullet point? If so, How can I do it?
Presumptive asked 4/4, 2011 at 1:52

17

Solved

How can I find the actual number of lines of a UILabel after I have initialized it with a text and a font? I have set its numberOfLines property to 0, so it will expand to however many lines are ne...
Stomatitis asked 23/1, 2015 at 11:18

7

Solved

I have a Label which takes dynamicaly some data from database. These data are strings which can sometimes be 3-4-5 rows etc. So this labe is inside a UIView. --UIView --Label How can i make the...
Middlebuster asked 9/9, 2016 at 11:41

7

Solved

I want the text in a UITextField (or ideally, a UILabel) to be non-editable, but at the same time give the user the ability to copy it to paste elsewhere.
Newell asked 17/12, 2009 at 9:40

4

Solved

I have a table that loads data from a database but the problem is if the text being loaded is too long, it goes off the screen. I'm trying to find a way for the text to go onto the next line and ha...
Enshrine asked 16/5, 2015 at 2:27

18

Solved

I have some labels which I want to adjust their height to the text, this is the code I wrote for this now func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILa...
Harald asked 7/8, 2014 at 10:43

9

Solved

i try to add border for a uilabel, but i only want to have top, right, and bottom border. like this ---------------- | I am a label | | ---------------- I try to use these codes, but it ...
Heartburn asked 5/2, 2014 at 18:57

12

Solved

I would like to make a UILabel clickable. I have tried this, but it doesn't work: class DetailViewController: UIViewController { @IBOutlet weak var tripDetails: UILabel! override func viewDid...
Beltz asked 11/11, 2015 at 19:39

23

Solved

I have a UILabel that can be varying lengths depending on whether or not my app is running in portrait or landscape mode on an iPhone or iPad. When the text is too long to show on one line and it t...
Daphne asked 19/6, 2010 at 20:25

4

I have a multiline UILabel as shown here: I achieved this using the following code: label.lineBreakMode = .ByWordWrapping label.numberOfLines = 2 I'm trying to "decrease" the line spacing bet...
Euchology asked 26/1, 2016 at 19:16

© 2022 - 2024 — McMap. All rights reserved.