uilabel

Handling Touch Event in UILabel and hooking it up to an IBAction

Ok, so I have a UILabel created in interface builder that displays some some default text of "tap to begin". When the user taps the UILabel I want it to trigger an IBAction method: -(IBAction)next; which updates the text on the label to say something new. It would be really convenient if this allowed me to simply drag a connection from m...

Can we modify the font of a Label created by IB from source code ?

Friends, I am a beginner and trying to know iphone programming basics. If I create a Label from Interface Builder and Name it as "Sample", can I change the font of this Label name from source code. Is it possible. I have no clue how to do it. Can anyone help me in doing this. Thanks In Advance, Anil ...

finding location of specific characters in UILabel on iPhone

I have a UILabel with some text, say "Hello World abcdefg" The label can have multiple lines, different font sizes etc. Question: How do I find the coordinates of all letters "d" in this UILabel. Logical first step is find the position of those characters in the string (UILabel.text), but then how do I translate that into coordinates w...

Draw background color in a UILabel rect only where my text is.

I need to create a custom UILabel to display some dynamic multiline text. The text color is white on a black background. But the background should only be visible right behind the text to simulate the effect of an selected text area. I started with subclassing UILabel and overriding drawTextInRect to do my own drawings. - (void) drawTe...

How is the text adjusting inside the label when we increase the fontSize?

In some of the applications, I have seen that we have an option to increase or decrease the fontSize of the text inside the label. But when we adjust it, the label automatically increases its height to contain it. How do we get the height of the label everytime we increase or decrease the fontsize? And in some cases like news applicatio...

NSArray data in UILabel

Hi friends, I am trying to put NSArray data by([array valueForKey:@"value_name"]) in uilabel it throws exception. Regards, sathish ...

How the Text readjusts when an image appears?

In some news applications when it loads it shows a list of articles. When we click on an article, it goes to its detailed page. In the detailed page 1st there will be only the text related to the article. But suddenly an image comes(related to the article) on the top left corner and the text re-aligns itself to contain the image. Wht ar...

activity indicator and CLLocation Distance

In my application i load at startup the distance between user location and a known point; I want to show at startup an activity indicator with a label "Loading" that then disappears to show the distance. How can I do? ...

UITextView text is pixelated when loaded from my XIB file

Ok, I've got a XIB class called MenuItemView with 3 sub views, a UIImage, a UILabel, and a UITextView. I'm dynamically loading instances of MenuItemView as pages in a UIScrollView. It creates a similar effect of scrolling through food items in the Chipotle app. My problem is, the text in both the UILabel and UITextView are becoming...

Inner Shadow in UILabel

is it possible to create such a UILabel with inner and outer shadow? i only know shadowColor and shadowOffset zoomed: thanks! ...

Cocoa Touch - Changing the text of a button and a label

Well.. I forgot how to change the text of a button and label in cocoa touch. Please remind me.. IBOutlet id questionLabel; IBOutlet id answerButtonOne; IBOutlet id answerButtonTwo; IBOutlet id answerButtonThree; IBOutlet id answerButtonFour; ...

Autosize UILabel

Is there a way to auto size a UILabel? given size 40 x 40 the text font size would adjust based on the number of characters. ...

Utility App and plist - is this the appropriate approach to making a flashcard style application?

Dear Developers, I am trying to integrate a question/answer section to one of my apps. I wanted to use a Utility style application where the question is loaded as a Uilable in the first view, and the answer is loaded in the flippedview. I was hoping to load the question and answer data from a plist, and integrate a shuffle option so ...

iPhone programming: Inserting labels between sentences

I have an interesting UI where a table view contains some lines of text. There are certain words in each line that I need to highlight and those words can be selected to render some tooltip. I thought of using labels for these words so I can highlight them and also capture any touch events. But I couldn't find a way of achieving a flow ...

Adding UILabel to detailTextLabel of a UITableViewCell

hi friends.. In my app that consist of a grouped tableView,the detailTextLabel displays dates entered through a datepicker. and i use this dates to retrieve data from webservice. What i want to do is to add UILabels to detailTextLabel of the cells so that i can access the label's text property to get the dates and send request to webser...

UILabels dont update on first load of the view.

I have UITableviews that set another views UILabels depending on the row selected. On the first selection of any row, the view loads with empty labels(nothing set), as soon as I navigate back and then when I choose a row after that it loads perfectly? Why arent the labels being set on the first selection? I have the following code ...

How to stack/z-position multiple UIElements (uilabel, uiimageview, etc) on top of each other?

I've got several UI elements on my screen (programmatically) and am in need of an efficient way to give each subview a z-index setting, so I can stack certain elements over others. Does anyone have a solution to this? ...

Programmatically perform an action on UILabel touchUpInside?

I have a bunch of UILabels that I add through code and I want to perform a specific action for each if the user's finger touches up inside (much like UIButton's touchUpInside in IB). What is the best way of doing this? ...

Plist with array of dictionaries: How do I load Item strings into a Utility style app?

Dear Developers. I am trying to load plist data into UILabels in a utility template app that has two views. There is a flip animation that allows switching between the views. Here is the structure of the plist: Root...............................(Array) ........Item 0.....................(Dictionary) .................Question.........

iphone problem making UILabel

Hi- I'm having kind of a dumb problem. I am using the below code to create/modify a UILabel via code. The reason I am creating it via code is because I need it to be rotated 90 degrees and Im not aware of a way to do that in IB. What's happening - A user hits a button that makes the text they selected to appear in the UILabel. Then wh...