How to do circular scroll view? - iphone

I am doing an application in which i have to show a semi circle on which there should be different options in scroll view. That means on that image of semicircle i have to show scroll in circular way .
How can i do that??
Can anyone please guide me ?

You mean you'd need to rotate the contents inside the semi-circle like in a "wheel of fortune" kind of way?
I don't think you can do that with a regular UIScrollView, you'd have to handle the touches and do the rotation yourself.
I'd recommend you start by taking a look at the "Touches" code sample from the UIKit docs:
http://developer.apple.com/library/ios/#samplecode/Touches/Introduction/Intro.html#//apple_ref/doc/uid/DTS40007435

Related

Create a UIScrollView that can be embedded into another view

I'm trying to build a custom, reusable UIScrollView that can be added to multiple views. The scroll view is going to be a weight picker. For the life of me, I can't find a decent example for how to implement this neatly or cleanly.
I would love for someone to point me to an existing library or tutorial that shows me how to do this. I've hacked apart a few examples, but so far, nothing is very good or reusable. Please help!!
For what it's worth, I have an image that individual ticks for the weight. So I can select to the tenth of the number (e.g. 160.4). The image has the first tick bold and larger than the remaining 9. I'd like to have the weight/number centered over the large tick. I'll update the points to my label/datasource after scrolling stops.
UPDATE
I need to make this. I have the custom font, background, and ticker image.
I would not do this through an UIScrollView. I think it would be more complex and you would certainly end up having issues when trying to add you custom picker into another scroll view.
What I would do is:
building the picker view by means of a series of CALayers, each one representing a "building block" of your picker view; see attached image:
each building block would represent a specific value by mixing a UILabel (the text) and an image;
use a pan gesture recognizer, or alternatively define touchesBegin/Moved/Ended method to deal with panning;
when a pan is done, you displace the view content to the left or right according to the panning;
when panning, you also add new building blocks to the left or right end of the picker to account for empty areas that would be revealed by the displacement done at point 4.
I think that having a look at another kind of custom control source code would be of great help to you. You would not possibly find your custom picker already implemented, but could get some guidance. Have a look then at cocoa controls.
Hope this helps.
If I were going to implement this, I would create a really wide image that had every weight on it I'd ever need - I would probably create this in code when the app started up. This image is then used as the contentView of your picker. You get all the scrolling features "for free", and you could even update the values shown in the other parts of the view during scrolling (or dragging.
The scrollView is just the area with the tick marks and weight numbers, and resides in a subview above the background, but below the centered vertical line that shows the actual weight.
EDIT: on second thought, forget the image. If you have the code to draw the image, you can do the drawing in a custom UIView. So you get the draw rect, you know the contentOffset, so you can draw just what you need.

Looking to mimic the iPhone lock screen camera drag

I've been searching and searching on how apple makes the dragging motion on the lock screen to open the camera so clean. I'm trying to do a similar thing with an app where you drag from the bottom up to reveal a menu, but i cant quite get it right. Anyone know how to, or of any tutorials that show how to do this? Thanks in advance!
To follow up what's been mentioned by Hejazi I believe you can achieve this in 3 steps:
create a background rectangle with some corner radius (this is a property of CGRect).
create a top view, corresponding to the part you want to be able to slide. Attach a pan gesture to this view so you will be able to handle the animation for this view.
for the text part being highlighted I think you need another two views: I will apply a mask corresponding to the text to a view so you get some transparency only for the letters of your text and animate a white round view behind it.

horizontal scrolling level select

Ok so i have a good chunk of my game finished now and Im working on my level select view. I want to implement a horizontal scroll view with multiple buttons on each view, in something that looks like Angry Birds or Cut The Rope, or something like that. I know I use a scroll view and set anchor points from my reading on here and other sites but im not sure exactly how i can implement that. Im a bit of a noob and my game didnt need to implement any real graphics so im not familiar with open gl or quartz, although im not afraid to try to learn it.
Anyone know how i can implement anchor points in a horizontal scroll view for my level select view?
Thanks!
As already answered, you have to use UIScrollView. We use scroll view when our contents are too large to be shown on the screen.
Refer the class reference here and Some links that could hep you.
Apple's scrolling demo
Understanding Scrollview

Custom Map iPhone

I trying to figure out how to create a Custom Map like the following:
http://itunes.apple.com/us/app/mall-book-california/id342584415?mt=8
http://www.macworld.com/appguide/app.html?id=541350&expand=false
I just don't know where to start from, do I use UIWebView or MapKit?
Any help will be appreciated.
Thanks
What we did in our app is use a UIImageView on a UIScrollView. You need to take a screenshot of the object you will map on the google-map and precisely draw your overlay over it. Also you need to take the top left coordinate and bottom right coordinate of the screenshot you took from the map. Then put the overlay image inside an imageview, image view on scrollview, and scale your coordinate system on the scrollview with the coordinates you took from the map. Now you can precisely plot POI-s on your overlay. A note: The first thing we did is we overlaid the g-map with custom image view but it was really slow when scrolled, so don't even try it. Good luck with coding.
[EDIT] you take a large screenshot of an area on google map like this
http://www.metacafe.com/watch/1073912/google_maps_hack_how_to_save_large_maps/

how to animate some portion of images?

I am implementing fun application.In which i want to animate some area(portion) of images.
I dont know how it possible.If u have any idea then please help me.
If you're looking to animate a portion of an image you could just create a smaller animation and put it at the right relative location inside a larger image.
If you want to know how to animate images in general, that's a different question entirely.