How can I remove UILabel's gray border on the right side?

uilabel text
uilabel swift
uilabel linebreakmode
uilabel attributedtext
uilabel example
uiview
remove subview from view swift 4
uilabel line break

I have added an UILabel to a custom cell's contentView. I met with a strange side effect. On the right border there is a gray edge. I don't know why. I just added an ordinary UILabel, I have done nothing else.

UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
label.text = @"value1";
label.textAlignment = UITextAlignmentCenter;
[self.contentView addSubview:label];

- (void)layoutSubviews
{
    UILabel *label = [self.contentView.subviews objectAtIndex:i];
    label.frame = CGRectMake(…);
}

I know this is an old question but I have just come across this exact same problem, so I thought I could help someone else looking.

For me the problem was that I had floating numbers in my frames. The following fixed it for me:

CGRectIntegral( myLabel.frame )

UILabel, You can configure the overall appearance of a label's text, and use attributed the system should ignore and remove user events for this label from the event  When the label has its size completely defined externally, you can specify how it handles the situation when its content doesn’t fit within the bounds. To reduce the font size, set the adjusts Font Size To Fit Width property to true and set the minimum Scale Factor property to a value between 0 and 1. The latter of these properties represents how much smaller than the requested font size the label scales the text.

I don't know the reason, but the solution is to get rid of that gray edge to set the background color of the cell to clearColor.

label.backgroundColor = [UIColor clearColor];

Remove padding around UILabel? : iOSProgramming, I'm thinking it might be something that the font applies itself but I can't find any way to remove. I just want the label to wrap tightly against the edges of the font. uilabel text padding storyboard (20) I'm looking to set the left inset/margin of a UILabel and can't find a method to do so. The label has a background set so just changing its origin won't do the trick.

First of all, you need to set:

[label setBackgroundColor:[UIColor clearColor]];

Next, set color that you want:

[label layer] setBackgroundColor:[UIColor redColor].CGColor];

How to remove a UIView from its superview with , Tap the account Label settings. Select the label you want to edit/delete. Tap Name. Create a new name. Tap Done. Information from https  For the tutorial for my app, I am trying to create a UILabel that drifts across the displayed screen when a view appears and then is destroyed so that if the user comes back to that view during the tutorial, the UILabel will be created anew and again drift across the page.

This is still happening on iOS 12.

Swift version of Ad Taylor answer:

myLabel.frame.integral

How do I edit label in my gmail for iPad 2018 6GE, Next to each label you don't want to see, click Hide. If ever you want one back, click Show. You have to set the numberOfLines property on the UILabel. The default is 1, if you set it to 0 it will remove all limits.

Can I and how do I delete labels in Gmail app for Android., Click to edit the card; Click on the label to be removed; In the label popup, click the label that you want to remove (or on the tick icon). enter image description  How to Remove Surgical Staples. Surgical staples are used to close surgical incisions or wounds that have fairly straight edges. The amount of time staples are kept in varies with the wound and healing rate of the patient.

How to remove a label from a card in Trello, Image - Stack - Label.. with the "Add as Overlay" option. I was wondering if there is the possibility to remove specific overlays or time labels? The doctor can do a biopsy — removing a small piece of the mole to test under a microscope to see if it’s cancerous. Dermatologists use two safe and effective methods for removing moles.

How to remove a custom label in Google Maps?, Handy buttons in the dialog let you insert or delete a label, or import and export labels to a file. See Labels Editor for more details. Add Label at Selection Ctrl + B. lbl = uilabel(___,Name,Value) specifies label properties using one or more Name,Value pair arguments. Use this option with any of the input argument combinations in the previous syntaxes. Use this option with any of the input argument combinations in the previous syntaxes.

Comments
  • Thanks for the floating number tip. I didn't want to change my frame size, so I created a UIView underneath the UILabel. I then changed the backgroundColor on the UIView and kept the UILabel clearColor
  • Thanks! I was having this same problem with UILabels in a UIPageViewController.