uilabel

UILabel and superscript

Hi I have two strings: a variable length piece of text another string with numbers that point to a reference In my view, the first piece of text is displayed in a UILabel, I adjust the size of the label to accomodate the size of the text. This means I cannot just place another UILabel on the screen, at least not without repositioni...

iPhone release Label text

I am trying to release the label text each time the person click on a book title from the table view, it should change the detailViewController label (titleLabel) however it keeps showing the same book title. Wondering If i have done something wrong - well I know I have but wondering how I fix it... // // BookDetailViewController.m #...

UILabel backgroundcolor is not updating in some of the iPhone and iPod device

Hi, I am creating 30 UIButtons dynamically for my custom calender in iphone application. I am also adding the UILabel as a subview in each of UIButton. I am setting different background color for each of the UILabels. When i try to change the background color of UILabel then on some of the iPhone device it is working fine but on some o...

Detecting touched character

I'm looking for the best way to detect a character (in a short string, drawn in a large font) touched by the user, and send an accompanying event. It looks like I might be able to do this by looking at the location of a touches ended event inside of a UILabel with "User Interaction Enabled" turned on, or maybe by programmatically creatin...

How to use NSNumberFormatter for currency to print in UITextField

Hey Guys , I am a N00b here . I print my currency like this : -(IBAction)buttonPressed1:(id)sender { double currency = [Amount1.text doubleValue] + [Amount2.text doubleValue]; SumCurrency.text = [NSString stringWithFormat:@"%0.0f", answer]; } I just simply want to use NSSNumberFormatter to print the SumCurr...

Using NSNumberFormatter to format currency in output UILabel

NSNumberFormatter * fmt; NSNumber * n; fmt = [ [ NSNumberFormatter alloc ] init ]; n = [ NSNumber numberWithFloat: 10 ]; [ fmt setFormatterBehavior: NSNumberFormatterBehavior10_4 ]; [ fmt setCurrencySymbol: @"$" ]; [ fmt setNumberStyle: NSNumberFormatterCurrencyStyle ]; // NSLog( @"%@", [ fmt stringFromNumber: n ]; [ fmt ...

How to figure out the font size of an UILabel when -adjustsFontSizeToFitWidth is set to YES?

When myLabel.adjustsFontSizeToFitWidth = YES, UILabel will adjust the font size automatically in case the text is too long for the label. For example, if my label is just 100px width, and my text is too long to fit with the current font size, it will shrink down the font size until the text fits into the label. I need to get the actual ...

Custom UITableViewCell with Partially Bold Text

Trying to implement a UITableView of names similar to the built-in Contacts iPhone app where the first name is in normal font and the last name is bold. A quick google suggests this isn't as easy as it sounds due to the iPhone SDKs lack of rich text support in UILabels. One of the solutions found recommended using a UIWebView to format...

Overflow on UILabels

I have a table view that I am customizing and I am adding a UILabel as a subview of the contentView, and I want the number of lines to be relatively consistent. I set the numberOfLines property to be 3 so it can't go more than that, but there are still some that overflow onto the 4th line. If it overflows, I want to add a a trailing .....

What is the default fontsize, fontname and shadow for titles in Navigation Bar?

I'm trying to have a button on the self.navigationItem.rightButton that toggles a segmented control that is placed in self.navgivationItem.titleView .. this will however remove the title that is first set by self.title when the navbar is created .. I dont know if my approach is bad but I figured I could rotate between a UILabel and the S...

pulling an UIImage from a UITextView or UILabel gives white image

Hello all, I need to grab an UIImage from a UITextView or UILabel. I've got a method that will pull an image successfully from other types of views ( [UIViewController view], MKMapView, UIButtons) but I am just getting a white rect for my UITextView. I've been banging my head against the wall for a while and suspect something really, r...

is it possible to set multiple color in UILabel?

Quote from Jason Coco it not possible to set multiple in UILabel... but how to do like this? any idea? is it possible to set mix color in UILabel example "TEST" can i set E to red color and another to white color? ...

How can I get the range of characters in a given line of UILabel text?

My task boils down to extracting the range of characters in a given line of a multiline UILabel. These lines are the lines that appear where the UILabel breaks to fit to width: in other words, not separated by hard line breaks. This seem to rule out lineRangeForRange:. Or am I wrong? Context : I have an iPhone game where a user taps UIL...

iPhone SDK reload UIView's content

I have two views, one view takes the whole screen, the second view covers only a little portion. What I want is for that second view to be on the first view (which I already have done), but the problem is, when I set values (in this case UILabel's) the label on the screen doesn't display that new value. I know for a fact the method get...

After adding a UILabel to my view, how do I delete it?

I have added a UILabel to my view programmatically like this: myLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 30.0f)]; myLabel.center = CGPointMake(160.0f, 120.0f); myLabel.backgroundColor = [UIColor clearColor]; myLabel.textColor = [UIColor whiteColor]; myLabel.font = [UIFont fontWithName:@"Helvetica" size: 18.0...

How to enlarge dynamically an UILabel (label and font size)?

Hello, Im currently working on an iPhone project. I want to enlarge dynamically an UILabel in Objective-C like this: How is this possible? I thought I have to do it with CoreAnimation, but I didn't worked. Here is the code I tried: UILabel * fooL = //[…] fooL.frame = CGRectMake(fooL.frame.origin.x, fooL.frame.origin.y, fooL.fr...

How to change the font size gradually in a UILabel?

Hello, is there a way to change the font size gradually in a UILabel? I tried it with: [UIView beginAnimations:@"foo" context:nil]; [UIView setAnimationDuration:0.8]; uiLabel.font = [UIFont boldSystemFontOfSize:144]; [UIView commitAnimations]; The problem is that the change of the font size happens instantly. ...

Change the text of a UILabel in viewDidLoad() programmatically

Hi everybody. I'm a beginneri iPhone developer. My code is the following: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) { displayLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 20, 230, 40)]; [self.vie...

Can I center a UIToolbar item?

I am putting a label on a UIToolbar (per this tip: http://stackoverflow.com/questions/333441/adding-a-uilabel-to-a-uitoolbar). But the toolbar has a button on the left side, and so flexible spaces throw the label off the center, which is where I'd like it to be. Can I somehow center this toolbar item so that it remains centered in the t...

Can not change UILabel text color

Hi, all I want to chang UILabel text color,but can't change it's color,This is my code. UILabel *categoryTitle = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 46, 16)]; categoryTitle.text = @"abc"; categoryTitle.backgroundColor = [UIColor clearColor]; categoryTitle.font = [UIFont systemFontOfSize:12]; categoryTitle.textAlignment = UI...