uilabel

Why am I getting an invalid NSString from SQLite for my UILabel?

I have a view with a UILabel and a UITableView. I'm using this code to get a string from a database: -(void)getOneQuestion:(int)flashcardId categoryID:(int)categoryId { flashCardText=[[NSString alloc] init]; flashCardAnswer=[[NSString alloc] init]; NSString *martialStr=[NSString stringWithFormat:@"%d", flashcardId]; ...

iPhone Development - Another question on resizng UILabel & custom UITableViewCell

Hi folks, I've used following function in some of my projects, but recently I've created a small example which suggest that it's not reliable (at least in some situations): [NSString sizeWithFont:font constrainedToSize:size] [NSString sizeWithFont:font constrainedToSize:size lineBreakMode:lineBreak] I created a custom UITableViewCel...

how to remove an object only if it exists on iPhone SDK?

I want to remove a UILabel from the UIView dynamically. There are some branching and looping, and in the end when I remove it by 'removeFromSuperview' sdk crashes as it doesn't exist anymore, in some cases. [lbl_timer removeFromSuperview]; So what i wanted is simply how to know if an object exists? thanks ...

Override UILabel's setText method?

I'd like to override UILabel's setText method but I'm not sure that A) it's possible and B) if maybe there's a better way to achieve what I'm trying to accomplish. I have a subclass of UIView that has a UILabel property as one of its subviews. I'd like to know when the UILabel's "text" property changes so I can adjust the size of the r...

How do I add a gradient to the text of a UILabel, but not the background?

hey, I want to be able to have a gradient fill on the text in a UILabel I know about CGGradient but i dont know how i would use it on a UILabel's text i found this on google but i cant manage to get it to work http://silverity.livejournal.com/26436.html ...

UILabel - setting font - typeface programmatically in iPhone

I have following code in my Application. tmp=[[UILabel alloc] initWithFrame:label1Frame]; tmp.tag=1; tmp.textColor=[UIColor blackColor]; [tmp setFont:[UIFont fontWithName:@"American Typewriter" size:18]]; tmp.backgroundColor=[UIColor clearColor]; [cell.contentView addSubview:tmp]; [tmp release]; Now, I need to know, ======> how to se...

sizeWithFont - weird behavior when containing the & character

Whenever an & is present on the text, getting the height seems to be off all the time. Both functions return less than the actual height: CGSize labelSize = [nameLabel.text sizeWithFont:nameLabel.font constrainedToSize: CGSizeMake( actualWidth, MAXFLOAT ) lineBreakMode:UILineBreakModeWordWrap]; CGRect textSize = CGRectMake(0.0, 0.0, 32...

duplicate rows in tableview on uitableviewcell

I have found some posts which are similar to my issue but not quite the same. In my app the user can navigate between several uitableviews to drill down to the desired result. When a user goes forward, then backward, then forward, etc it is noticeable that the rows are being redrawn/re-written and the text gets bolder and bolder. I ...

UILabel displaying Unicode Characters

Hello, I have an NSString that then sets a UILabel. This contains unicode such as... E = MC Hammer\U00ac\U2264 and complete ones such as \U2013\U00ee\U2013\U00e6\U2013\U2202\U2013\U220f\U2013\U03c0 \U2013\U00ee\U2013\U220f\U2013\U03c0\U2013\U00aa\U2013\U221e\U2014\U00c5 These are not displaying correctly, is there anythi...

Justify text in a UILabel (newspaper style)

Is this possible? the effect I want is for the text to align so the left and right sides are straight. Similar to the style of a newspaper. Thanks! ...

IPhone - Move detailTextLabel within UITableViewCell

I am building a UITableViewCell. I am using the style UITableViewCellStyleSubtitle for my table view cell. In the textLabel of the cell I have data that can require a wrap. So to accomodate, I want to move down the detailTextLabel so that the wrapped text isn't covered by the text in the detailTextLabel. I am attempting the following...

UILabel Question. Aligning overlapping UILabels.

I have two UILabels. that I want to overlap one atop the other. Call the labels "under" and "over". over: A C E G under: B D F UILabel "over" will have its text drawn in red. "under" will be in blue. The visual effect will be alternating colors between successive letters. What are the controls available to me to exactl...

Setting UILabel - Font through code - generates error - iPhone

See following code carefully. Because it works perfectly. Try to add in your application. it will work - (void)viewDidLoad { [super viewDidLoad]; // title label - tip UILabel *tmp=[[UILabel alloc] initWithFrame:CGRectMake(50, 50, 200, 200)]; tmp.textColor=[UIColor colorWithRed:(14.0/255.0) green:(105.0/255) blue:(128.0/255) alpha:1.0];...

fitting a text(height adjustment) in a table cell's UILabel

Please see screenshot below. See how some of the words/text overlaps the lines? I have soared the net for answers and this was my last attempt: CGSize labelSize = [nameLabel.text sizeWithFont: nameLabel.font constrainedToSize: CGSizeMake( actualWidth, MAXFLOAT ) ...

iPhone - UILabel containing text with multiple fonts at the same time

I am looking for a way to use a UILabel (or something similar) to display something like this: Tom: Some message. It is like how it's done in for example the Facebook app to display the "what's on your mind?" messages. Does anyone have any suggestions how to approach this? ...

uitableview subview : why this uilabel is not visible?

I want to display a label showing a number in each cell of the tableview but the label is only visible when I click on a row (when the cell is highlited) - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UILabel *label; UITableV...

Drag UILabel from point A to point B

How can I go about dragging a UILabel from point A to point B on my iPhone application? ...

Can I set a UILabel to expand to fit an arbitrary amount of text?

This question is more for development purposes and would never be used for a shipping app. I need to do a quick and dirty UILabel whose text field I can point to a really, really, long string. Really long. I've ben futzing in IB and can't figure out the correct magic handshake to allow a UILabel to balloon to a really large size. Does an...

Assigning different labels dynamically

Hi everybody! After detecting Button sender through its tag in an action method, I want to dynamically assign some text to the corresponding Label (say, button tag+10 ) using some sort of temp UILabel var. Hoping that's understandable?..english is not my native language :) thank you. ...

Unable to Access UILabel in UITableViewCell

I am having trouble in accessing which is in the UITableViewCell, that i have placed in my main .xib file. That Label is connected to IBOutlet servicesCell. And the Label inside the table view cell is connected through IBOutlet serviceLabel. At runtime i am not getting the text which i am assining to that label. Following is my sampl...