iPhone view layering - iphone

I have a pretty abstract question, because I'm not sure exactly how to ask it. I have a UIImageView on one of my views. I want to have the imageview look "pressed into the superview". I'm not sure what the technical term is, but I want it to look 3D and like the imageview has been pressed into the page. Is there a way to do that?

You want it engraved into the superview? Create a "frame" decorative image in Photoshop, Gimp, … and add it to your interface. Google "photoshop engraved frame" for hundreds of results.

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!

iOS - UILabel editing, overlaying an image?

As you can probably tell from my last few questions, I am working on a screen that allows users to edit labels. Pages and all the other lovely apps have glorious resizing handles to show what label is currently being edited.
I am trying to get some feedback on the best way to do this. Is it possible to add an 'dot' image to the centre of all the edges of the label? Is it possible to change the background colour only in sections of a label?
Or should I add an image on top of the label and disable it? The most important feature is for only the uilabel to respond to touches. If I overlay an image, I want it to ignore the touch and hand it off to the label.
Any feedback appreciated!
Cheers Guys!
You will find as many opinions on this as there are programmers. There is not built-in decoration for a view that shows the dot in the middle of each side. But you can add that easily enough. One way is instantiate four instances of an image with the dot and add them as subviews of the view you are decorating. you can then set the center of each dot on the center of each edge in the parent view. As long as clipping is turned off in the parent view, these will show up (if they are not hidden) even if they extend outside the frame of the parent view.
I don't understand what you want to accomplish by changing the background color in sections of the label view, but I this probably has some moderate complexity to it.
You can also to this with core graphics. I'll stop there, though. There are literally many ways to do what you are trying to do.

Touchable area of a UIButton

Is there any way to define which area of a UIButton is clickable? In my case I would like to have PNGs with an alpha channel overlapping. These PNGs should act as buttons - but only where alpha is > 0. Is there a way?
Best
Stefan
Don't do that. According to the Apple Human Interface Guidelines, all UI elements should behave in a consistent manner.
OBShapedButton is an awesome project that will give you a button that will only respond to taps that are in the images area. I've messed with Irregularly Shaped UIButtons and I think OBShapedButton is a little more accurate. Not trying to bash on the other one at all. I've used the other and it works just fine. I've just seen a more accurate hit area with this one.

"Slider" type label as seen on Facebook and AP Mobile News

Please pardon my lack of Photoshop skills, but I'm curious what type of strategy Apps like Facebook and AP Mobile News are using for the 'label slider' in their applications. Here's a quick snippet outlining what I'm talking about as I'm sure the name I'm labeling the utility as is being butchered: http://dl-client.getdropbox.com/u/57676/slider.jpg
Essentially the user can touch the label and glide it along the X axis. It has a smooth bounce effect also once it hits the edges. This gives quite a bit more real estate if you need to present more on the screen than what your portrait mode allows for and is thus very valuable.
Is it a matter of just creating a UILabel that's wider than the screen with a bit of Touch API + Core Animation? Would love insight on how to start tackling this thing.
You'll most likely want to use a UIScrollView, with a UILabel as its content view. Size the label appropriately to your content, and then set the contentSize property of the scrollview to that size.
I created a similar control, and it's much easier than you think. It's just a UIScrollView with a series of UIButtons added to it. You could use labels instead of buttons - just depends on the feel you want. I think Facebook is probably using labels for theirs.
In any case, you'll probably want to use a series of components rather than one component (which is what Ben suggested) in the event that you want to, say, style the "selected" label differently from the others. It also makes hit detection a little easier.
You get the bounce effect for free by default - you may have noticed that most scroll views in iPhone apps do the same thing. It can be turned off as well.