Can a UILabel be part of a created image? - iphone

I have a project where I let the user draw on the screen of the iPhone (signature box). It works great... prints to a specific label printer (Zebra gx420d). My question is as follows: Can I have a UILabel field be part of the "Image" that is drawn? It is visible on screen, but doesn't print.
Any help would be appreciated!

Just make sure the label and your custom view subclass that draws the signature are both subviews of a common superview. Then invoke print on the common superview, and both of them (actually all subviews) will be part of the printed image.

You need to draw the text into an image graphics context.
This question may help: How do I use the NSString draw functionality to create a UIImage from text

Related

Make bottom part of UITextField(UIScrollView) transparent

Here's a good example that sums it up:
This is a UITextField that contains long text, so the user is able to scroll down to view the rest of the text.
How can I make the bottom rows appear "transparent"?
UITextField only allows setting global text properties (like color, font size, etc).
The trick is to create a CALayer containing a gradient and use it as mask layer of your UIView's layer (alpha values of the mask layer will be used.) see this answer: UIView border with fade or blur effect
This will help you.Not sure but some functionality like you want.
Hope this helps you.
All the best !!!

Resizing UIImageview with a UITextview using UIGuesture

I'm new in Iphone. I have an UITextView inside a UIImageView . Now I need to dynamically resize the UIImageView so that its textview also change its size dynamically. Moreover I can move this UIImageView with UITextView around the screen. If any one knows this using UIGuesture please help me.
Any help would be appreciated
If you are looking at resizing the UIImageView object, look at the UIPinchGestureRecognizer. It will have a property called scale that you can use to change its size.
As for the UITextView object that is the subview, you can look at autoresizingMask property inherited from UIView. Set it appropriately so that the text view scales in response to its super view.
For moving the image view, you can use the UIPanGestureRecognizer. You can get the translation using translationInView:. Use this to modify the center of the image view object. This should move the image view as you drag your finger around.
I hope you've gone through the guide. Let us know if you face problems implementing this and put some code so that we can guide you in the right direction.

What's this UI element?

What's the UI element that is top of that number buttons to display number ? (which is in light blue color)
It looks like a UINavigationBar with a prompt. However, the location of the gloss (which differs from your typical UINavigationBar) and the centering of the numbers (not shown) makes me think it is a custom view.
If you're trying to replicate it, I'd suggest starting with a UIView. Add a UIImageView with appropriate image for the the blue background and a UILabel for the text. Or, instead of the UIImageView, you could draw the background in the UIView's drawRect: method.

Can I use DrawRect on a UIImageView loaded from a NIB?

I've created a NIB file with some button controls on it, and as a background it has an ImageView which contains a PNG file loaded from my project.
What I want to do is to draw on top of the ImageView - imagine that my UI is a clockface and I want to draw the hands of the clock on top of the background image.
Is it the correct approach to try to subclass the UIImageView and use its DrawRect as when I use the DrawRect of the default view I don't see anything on the screen?
I'm a little lost as I'm finding this particular bit of the documentation hard to follow.
Thanks.
Create a new custom UIView (e.g. named HandsView) that sits on top of your background view (by adding it as a subview of the UIImageView). In the custom view, you can use the drawRect method. Make sure, you clear the context to transparent, so that the background image can be seen below the HandsView.
If you just want to draw turning hands, you can also try to use two fixed UIImageViews with the images of the hands and use the transform property to apply a rotation.

iPhone UITextView position relative

i got a news page (a view) at my application and it has news' image and text. Text is in a UITextView and i want my text to start next to image and when the image ends continue from the down of the image, like the text is surrounding the image. i tried autoResizingMask but as i ve understood it is for the relations between subview and superview so it didnt work. Is there any way to do it ?
Thanx in advance
AFAIK, UITextView doesn't support wrapping around other views. You can:
Split the text into two UITextViews
Use a UIWebView
Do your own drawing using NSString's drawInRect or drawAtPoint methods.