iCarousel ZOOM(pinch) - iphone

I would like to add zooming capabilities to the currentItemView . I've tried to create a scrollview and add it as a subview of the view from the datasource method. But had no luck doing it.
If anybody has an example and is willing to share it please do so. Or at least some proper steps in order to succeed. Thanks.

Add an GestureRecognizer to the View.
First of All Add an UIImageView to the View which is of same size as the Icarousel images.
Then Add that UIImageView into the ScrollView now you can ZOOM the UIImageView you have created.
AfterWards add the respective code in Icarousel DidBegin Scroll method to hide the UIImageView.
Since I'm not having that much time, but i have an example for you in GitHub for showing an example of Presenting an Animation with Icarousel, you can find it Here :)

Related

Adding UIButton to UIImageView within UIScrollView on Swift

I am writing an application for an event my organization is hosting using Swift. I have an image with the floor layout and want to add buttons to select locations (such as bathrooms, entrances, exits, emergency sections, etc) so that people can click them and information about the location pops up.
I currently have an imageview with the floor layout within a scrollview to allow the user to zoom in and out of the image. When I try to add buttons to the scrollview they don't stay relative to the image when zooming in and out, nor do their size change. I have tried adding constraints on to make the location stay the same when zooming in and out.
It also won't let me relocate the button on the storyboard to be a subview of the imageview. Looking up similar solutions says to add the button programmatically as a subview of the imageview but then it'd be really hard to put the 100+ buttons in the right location. Any suggestions as to how to go about this?
you have no other choice instead of adding by code.. because from code you can add as subview of image view , whereas Storyboard wont add buttons as subviews of imageView, but it will add buttons as subview of Scroll View

Drag and Drop UIView from a UIScrollView within a UIPopOverController to main UIViewController?

Okay, I'm having trouble getting this to work right. If anyone has successfully done this, and would be willing to share the code, I'd be forever in your debt!
Here's what I'm trying to do...
I have a main ViewController that I create my UIPopoverController from. This PopOverController contains a View that contains UIImageViews. These UIImageViews are programatically created in the viewDidLoad method of my PopOverController. I'm trying to get the UIView to pan from the popoverView within my PopOverController to the main ViewController that presents the PopOverController.
I got it to work kind of...
When a UIImageView is panned, I create a UIWindow and add that UIImageView as a subview to the new window. I can then pan the UIImageView outside the PopOverController, and in the Gesture ended state, remove the UIImageView from the window I created and add it to the keyWindow. However, when I do this, the UIImageView is rotated counter clockwise, and the panning of that view/window does not start under the finger. I'm not sure why that's happening either. I'm sure both issues are part of the same main thing I'm missing.
I made a separate project with just the part I can't get to work right. If you're bored and feel up to the challenge in getting it to work.. Here is a link to download the project.
I haven't completely solved your problem, but I had a look at the project and I solved the problem (in your setting) of not having the rotated UIImageView initially appear at the correct position. You need to use the superview of the piece when you convert the rect, i.e., (line 72 in popupcontroller.m)
newPiece.frame = [piece.superview convertRect:piece.frame toView:dragAndDropWindow];
Hope this helps a bit.

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.

How to slide button vertically in iphone?

How to slide button vertically in iphone by programmatically ?
Hey i have 7 images. and i want to display only 3 images vertically. and other images will be display when user scroll it upward.
Take a look at UIScrollView class :-) and then at UIImageView
If I understand what you want to do...
But we won't code you the thing ;-)
Good Luck.
add scrollview and setPagingEnabled =yes;
then
two way
1.add all images in view as subview and set the frame of them by one by one
2.in one view while scroll up add next image in view and remove old image.
right.Got it?
i think this tutorial will help you
http://www.edumobile.org/iphone/iphone-programming-tutorials/pagecontrol-example-in-iphone/

how does a subview of a scrollview know the scrollview is being scrolled

I placed a few uiimageview objects into a scrollview. How can the imageview know the scrollview is being scrolled? Since the imageview is a subview of the scrollview i can't set the scrollview delegate to the imageview.
I want to create something similar to the apps view on the iphone. Where you can hold down an app and then drag it, but if you hold and move your finger too far to the left or right the action is stopped and scrolling takes over.
"Since the imageview is a subview of the scrollview i can't set the scrollview delegate to the imageview."
And why not?
You have viewcontroller which shows the particular scrollview correct? this viewcontroller should be the delegate of the scrollview, and viewcontroller should also hold pointers (either explicitly in an array or through tag of some sort) to the uiimageviews.
Then, whenever scrollview notifies viewcontroller (through scrollviewdidscroll type of delegate method), implement your logic to update uiimageview.
To implement the exact touch sequence, you can subclass UIGestureRecognizer or write your own touch handler.. take a look at Apple's documentation on Event Handling Guide :
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009541
It doesn't, it just draws and draws. The scrollView makes sure you only see the part you really want to see
You might want to look at three20, they have a class that is very similar to the springboard. -- Used in facebook.app
Thanks Everyone, but I found out that UIScrollView sends the touchesCancelled message to the subview when scrolling starts.