uilabel

UILabel height?

I have an uilabel setup with IB and with this code: // setup label sv.text = @"When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate and equal station to which the Laws of Nature and of Nat...

UILabel sizeWithFont: problem. Clipping italic text.

I have created a UILabel that displays a single large character. Even with clipsToBounds = NO; I still get clipping. See link: http://img341.imageshack.us/img341/5310/screenshot20100814at243.png I used the following code: CGSize fBounds = [myLabel.text sizeWithFont:cFont]; To get what should be the bounding rectangle of the font. ...

Change font name AND weight in UILabel (iPhone SDK)

Maybe I'm looking at the wrong place, however how do I set an UILabel's font and AND its weight? Looking at the documentation, there seems to be only methods to create an UIFont with a given font name and size, like [UIFont fontWithName:@"Helvetica" size:22]) OR create a bold font, with [UIFont boldSystemFontOfSize:22] How can I...

Scaling UILabel text with the parent view

I have a UILabel that is a subview of a larger UIView. Is there a way to keep the text inside the UILabel proportional to the parent UIView so that when the parent changes size, either smaller or larger, the font size for the text in the UILabel will grow and shrink proportionally? ...

How to know the displayed text in UILabel ?

Hi, I have an UIView containing two UILabels, in order to display a string. The first UILabel has a fixed size, and if the string is too long and can't hold in this UILabel, I want to display the maximum characters I can in the first UILabel, and display the rest of the string in the second UILabel. But to make this, I must know the ex...

Resizing UILabel to fit with Word Wrap

This is part of an iPhone application but should apply to Cocoa written in objC in general. I have a UILabel holding various amounts of text (from single characters to several sentences). The text should always be displayed in the largest possible font that fits all the text within the UILabel. The maximum number of lines is set to 4 an...

How to calculate UILabel width based on text length?

I want to display an image next to a UILabel, however UILabel has variable text length, so I don't know where to place the image. How can I accomplish this? ...

UILabel wrong size calculations on iPhone

Hi all, I am adjusting my old apps to iPhone 4 using the simulator at the moment and I can across a very strange behavior with UILabel drawing and sizeWithFont:constrainedToSize: that I currently see only on the iPhone 4 simulator. I am trying to show the following error text to the user: @"Incorrect user name or password" This text si...

Problem in UITableView custom cell

Hey all, I am trying to add custom labels to my cell in UITableView. When I try to do this the display is messed up and I am unable to figure out what exactly is going on. Please find the image below and I will post the method I wrote.. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPa...

How can I clip a UILabel during animation?

I am animating a UILabel over a custom button. I want it to appear as though the UILabel is "rolling onto" the button from the right. My plan is to position the label 50 pixels to the right of the button, begin animation, move it to its correct position, and commit animation. However, throughout the animation I want to clip the label ...

MobileSafari UILabel

Hi, I was wondering how the UILabel that displays the website's title in Mobile Safari is created? It's obviously some kind of a subclass and I've attempted to copy it by using my own subclass,but it just doesn't look the same. I also don't know which font they're using :/ Could anyone help me out please? :) here's my class: CGSize s...

UIImage in the end of UILabel text

Hi there, how to find coordinate of the last character in UILabel if we have more then 1 line of text in it? I would like to add an image in the end of the text. ...

How to update a UILabel immediately?

I'm trying to create a UILabel which will inform the user of what is going on while he waits. However the UILabel always delay its text update until after the system goes idle again. The process: [infoLine performSelectorOnMainThread:@selector(setText:) withObject:@"Calculating..." waitUntilDone:YES]; [distanceManager calc]; // Parses ...

Cannot unhide UILabel or UIImageView

I've just started iPhone development, and have come across an annoying problem. I am transitioning from one view to another, however in the interim I'd like to display a loading image. The controller currently contains a TableView and TabControl. I have added an image and label to the control (of a 'loading' image) and linked them up to...

iPhone SDK Managing Memory for Multiview app

I have an app that programmatically creates labels and text fields based on the contents of a text file. Whenever the view controller is loaded, it creates text fields and labels that are different each time. My problem is I need to clear out the labels and text fields without releasing the view controller since I need to keep track of t...

UILabel with some effects

Hi, Can anyone help me how could I achieve an effect like this image sample image on a UILabel. As you can see there some like a stroke/bevel effect on the label. I got this image from a clock app so it means that its not a static image. Thanks in advance.. ...

How can I know upto which part in a NSString a UIlabel can contain?

I have two labels side by side in the ipad with each taking half the screen. I dont want to use the scrollview. I just want the left label to contain the exact amount of test it can and want the remaining to go to the right label. How can I get the length of the string that a fixed size UILabel can contain? ...

iPhone function to create UILabel fails and crashes

I have a view with a scrollview. I use code to add labels to the scrollview. Since there's a lot of redundant code, I tried to move the label creation to a separate function that returns a UILabel. Here' that function: - (UILabel *) f_MakeLabelWithL:(float)MyLeft T:(float)MyTop W:(float)MyWidth H:(float)MyHeight Align:(UITextAlignment...

Align UILabel Text Top While Limit Lines and Truncate

I found this post for aligning a text label top that was very helpful. - (void)sizeToFitFixedWidth:(NSInteger)fixedWidth { self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, fixedWidth, 0); self.lineBreakMode = UILineBreakModeWordWrap; self.numberOfLines = 0; [self sizeToFit]; } Is there a way to extend ...

UILabel strange behaviour

hi, i have this: - (IBAction)checkupdate { statusText.text = [[NSString alloc] initWithFormat:@"Checking......"]; everytime i press button, the string get display, ok no problem with that. now when i add NSURLRequest *theRequest = [NSURLRequest requestWithURL: [NSURL URLWithString:@"http:/myserver/version.plist"] ...