views:

51

answers:

3

Hello guys!

I would like to show some text with an image. But I would like the text to flow around the image. How can this be done? I've seen I can add views to a label, but I think just adding an image and then text it will not work. Can you point me to the right way please?

Here's the sample image

And thanks again. :)

A: 

I am not sure, but Three20 is the most powerful project that I have ever seen in Iphone to support text and stylesheet. You may want to take a look

vodkhang
A: 

Based on your sample image, this would be a custom object that you would have to create as a subclass of UIImage ..or you could go the easier route just make it as a view in Interface Builder that you add as a subview.

An example of subclassing UIImage would be like creating a helper method:

@interface UIImage (Labels)
- (UIImage*)toSize:(CGSize)size withLabel:(NSString *)label1 andSecondLabel:(NSString *)label2;
@end

but you would have to then implement drawing it all by yourself.

Instead, I would probably say go the route of creating a view in Interface Builder that has:

(1) UIImageView

(6) UILabels

that you can use as a subview and then you'd set them to whatever values like normal in code.

iWasRobbed
+1  A: 

The best way to go about this is to create a UI Label for the side of the image, then another UI label below the image - then calculate the height of the first label a word at a time from your original text, once you have gone past the height of the UIImageView put the rest of the text in the bottom UILabel.

If you would like some example code, please email me at kendall.gelner AT kigisoftware.com (I tried to look for a way to email or DM you, but could not find one on this site).

Kendall Helmstetter Gelner