Replicating Mail Contact "Bubble" in iPhone SDK - iphone

When creating a new message using Mail on the iPhone, and after typing the contact, a blue "bubble" appears around the text. Is there some way I can replicate this behavior in my own application?
Thanks for any help!

The way I do this and probably the easiest way is with a custom UIView. You can draw inside a clipped rounded path with a blue gradient then draw the text on top of it.
You could also take a look at the Three20 project, which has a similar control. However, it's very complicated if you're just looking for that blue bubble.

Related

Drawing overlay view on top of a web view

I am trying to make an app that can annotate PDFs.
What I have done, is add the PDF through a UIWebview, so my main UIViewControllerhas a UIWebView Delegate.
What I am trying to do is put my drawing layer, which is a UIView over the top of my PDF view.
I have tried setting the background colour to "clearColour" and the opaque property to no, I still get a weird affect.
I think the issue might be because of drawing a bitmap onto the UIView, but I would still like some insight, or an example if one exists.
Thanks.
This is an image of the problem, the little white band at the top is the PDF, the white box is the UIView which I am drawing on.
The code I used for the "drawing code" is here, see "SmoothedBIView"
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk_freehand-drawing/
Sorry, just noticed you had two questions. Again maybe this project can help you.

Make fix size round button as image in iphone sdk

I am developing an application in which I need to round button as image (as I uploaded).
It Show two corner are straight and the rest is in round shape. I tried withmybutton.layer.cornerRadius but make round whole image. I also tried to just make custom button but it leave extra space in button around image i need to fix size button as image show.
Please help me. Thanks in advance. Happy Day.
Here is a one good tutorial on this:
http://iphonedevelopment.blogspot.in/2010/03/irregularly-shaped-uibuttons.html
you can download code from here
https://github.com/ole/OBShapedButton
Hope this helps
An alternate but not really a good one first add an imageView add this particular image over it than add an custom invisible button over the image by adjusting size of the button it will not cover the whole image though but still it will work fine...actually i did use this approach in one of my app :p
OBShapedButton might help. It's an open source UIButton subclass optimized for non-rectangular button shapes. If it still doesn't work, making your own buttons isn't that difficult either. Use a UIView and handle touches within the view. For eg, in touchesMoved:, set the active image and in touchesEnded:, handle the click event!

how to draw a popover view instead of using image on iPhone?

just like the popover in the attached screenshots, the popover allow user to change themes.
I know that there are some examples around but they are all using images to achieve this, make it hard to change themes.
I believe the app in the screenshots doesn't using images to do it.
thanks for any help!
In my Win background such skins (called "Flat" in Delphi and WinForms) were made by drawing in code: select a color, draw a line, select another color, draw a rounded rectangle and so on.
Also, it is necessary to introduce a class "ColorTheme" with a set of fields for every color used. You may have several ColorTheme instances and swap them when you need to change color theme.

iPhone hide portion of image in UIScrollView

I am brand new to iPhone app development. I am trying to create an image reader using UIScrollView. I need to focus a portion of an image and hide the rest. Till now I am only able to focus required part of an image but have no clue how to hide the rest. I had a suggestion that, I need to add four views at top, bottom, left and right. I need to hide those as per requirement. But, I was able to go no where with the suggestion. Can you please tell me how can I implement the functionality?
I don't understand what you really want to do. But if you think putting for views above I might suggest you use mask image for the same. Use alpha component.
Atlast I was successful in hiding part of an image. I used four views with background color and resized them according to the portion I need to display.

thick shadow with no blur on UILabel

I am trying to add a thick shadow to a UILabel, without any blur. In photoshop I would use the "Spread" option to make the shadow look like this. It's for a comic book themed UI in an app I am developing. I cannot use images as the text is dynamic and different for each user.
Here is what I am after (on the left) and here is as far as I have gotten so far with CGShadowWithColor (on the right):
Anyone know how I can achieve this result?
A quick hack to try would be to have several black UILabels below the white one, each offset slightly.