Looking to mimic the iPhone lock screen camera drag - iphone

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.

Related

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

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.

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.

slideshow using touch sequence for the next image

in xcode just doing the transition. set of image in the nsarray,like slide show. have to change the image using transition for right to left using touch
I think you have to describe your question briefly.You can use Page control for that.It may be more useful to you.
You can get sample code in below link "http://developer.apple.com/library/ios/#samplecode/PageControl/Introduction/Intro.html"
use the leftswiping gestures and right swiping gestures.

View Behind View rolldown effect on iOS (Like folders on home screen)

What would be the best way to accomplish the home screen folder roll-open effect with views in Objective C?
I tried something similar to what MaxFish has described. You can check it here iOS Open Folder Animation Sample Code
If you take a look at the images inside the Springboard.app in your iPhone in "/System/Library/CoreServices" you can have an idea of how the animation works.
A simple version of the effect can be done this way:
Take a screenshot of the screen you want to "cut" and save it in an image
Create two imageviews each of which has a part of the screenshot (e.g. the first has the first upper part of the image as background, the second the rest), you could alternative use the same background image for both views, you have only to play with content alignments.
Place the two views on the original screen in the exact position to make them seem like one entire image perfectly aligned with the original screen.
Create a view (folder content) with its own background and whatever you want to put inside, place it at the same Y of the bottom imageview but beneath it.
Make the bottom image view scroll down for the entire size of the content view, you will see the folder content appear.
iOS version put on the sliding images some nice borders and applies fade effect which make the overall animation really cool. You can sure try and make it nice looking.
Hope this helps