Use a UIPanGestureRecognizer to rotate view
Is it possible to rotate a view using a UIPanGestureRecognizer? I would like similar functionality to the rotation gesture but with only one finger. Thanks. ...
Is it possible to rotate a view using a UIPanGestureRecognizer? I would like similar functionality to the rotation gesture but with only one finger. Thanks. ...
I feel like this ought to be simple, but after searching high and low I can't find an answer to my question. I'm developing page swiping funtionality similar to Mobile Safari, where one page will fade out as it is swiped out of view and the other page fades in. Each "page" is a plain, white UIView with a small UIImageView, displaying a...
Hi, I'm designing an iPhone app right now that uses a custom UIView that displays a photo and then some quartz drawing over it. Right now, the drawRect function for the view looks like this: [image drawInRect:[self bounds]]; //some quartz drawing code here The problem is that when the image is hi-res, the program lags a...
I'd like a UIView to slide up from the bottom of the screen (and stay mid-screen) like a UIActionSheet. How can I accomplish this? UPDATE: I am using the following code: TestView* test = [[TestView alloc] initWithNibName:@"TestView" bundle:nil]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.4]; [UIView setAni...
I have a Drawing app of sorts and am looking for some feedback on ways to draw a selection rectangle, and or the resize grips for a selected view. So I have a custom class that is inherited from UIView, in it it contains a UIImageView, UILabel, and UIButton. I can have several on the screen at one time. I want to tap on one and draw a ...
I'm trying to resize my app's view whenever an iAd is scrolled down from the top. The problem is that in run-time, when i set the resized frame size of the relevant view, the resizing doesnt happen 9so the iAd is draw on top of the top 50 vertical pixels). If I set the UIView size at design-time, then I see that the view is resized (whe...
I have a UIView which has several buttons added to it as subviews. Currently I have the buttons in drawRect:, which I have heard is a bad idea because drawRect can be called several times. I tried to move these UIButtons to initWithFrame, but they just don't get drawn. How should I fix this? I am not using interface builder, so there ar...
Hi, everyone, I want to ask a question about the UIview on the iPhone applicaiton. I want to display a image one the UIView programmatically, but I don't know how to do it. What should I do to display the image. Thank you very much. ...
I have a circular image which i am trying to rotate so that the yellow and black striped circle stays under the users finger and rotates in both directions. I have this so far: - (void)handleJogShuttle:(UIPanGestureRecognizer *)recognizer { UIView *shuttle = [recognizer view]; if ([recognizer state] == UIGestureRecognizerState...
What are the coordinates used in UIViews and their corresponding superviews? I have this code which i would like to detect a 'corridor' where the user can touch... similar to this image: This is the code i have: CGPoint touch = [recognizer locationInView:[shuttle superview]]; CGPoint centre = shuttle.center; int outerRadiu...
Using this code I am able to added two uiviews to my window - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UIViewController* test = [[UIViewController alloc] init]; UILabel* label = [[UILabel alloc] init]; label.frame = CGRectMake(0, 0, 100, 20); label....
Hello guys! First here's my code: [_helperView addSubview:_navigationController.view]; [_helperView addSubview:itemView]; [UIView beginAnimations:@"pageFlipAnimation" context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:_helperView cache:NO]; [UIView setAnimatio...
Hallo! That's really strange.. i'm changing the frame between two states. In case one, it's animated correctly, in case two (back to original size) only x/y is animated, but width/height instantly changes. Any Idea? Greetz // strange behavior [UIView beginAnimations: @"photobtn" context: nil]; [UIView setAnimationDuration: 0.15...
Question regarding layer two bitmaps on top of each other, one of which is semi-transparent. I have a custom UIView called foo. I have two CGBitmapContext's I have created. They are effectively being used as offscreen buffers and are of equal rectangular dimensions. I want to take the two of these offscreen and layer them one on top of ...
Hi, For my iPad app, I'm using a UIViewController subclass called SidebarViewController to display some stuff in a sidebar. In the sidebar I have a calendar control. I'm using the open source Kal component from http://github.com/klazuka/Kal. In the -viewDidLoad method of SidebarViewController, I'm creating a new instance of KalView (the...
HI, everyone, I want to ask a question about the iPhone application. I am writing a program. The program will ask the user the enter some information and press enter, after that the program will process and get some information, then the program will display the tab page with 3 tabs. However, I don't know how to switch the page after t...
I've got the following node in my XML layout: <com.x.y.view.TagLayout android:id="@+id/TagLayout" android:layout_width="fill_parent" android:layout_height="170dip" /> TagLayout is a class that extends ViewGroup, and basically holds a bunch of buttons with text (a custom object that act as tags, but that's neither here or there). The...
How would i use a PanGestureRecognizer's translationInView which returns a CGPoint, to track the user touch location so that i can rotate an image so that the point where the user touches stays under the finger? I can use CGAffineTransformRotate to do the rotation but it expects a rotation angle in radians. Currently i am using M_PI/20;...
I need to rotate a circle by an amount equal to the distance travelled by the users finger... This would equate to the length of the arc moved by the finger... I know the radius of the circle, but need to calculate the central angle and maybe the arc length. Can i do this using any functions in PanGestureRecognizer? translationInView? ...
Should setting an autoresizeMask on a subview and autoresizesSubviews on the superview automatically resize and rotate the view if the return value for shouldAutoRotateTo... is YES? Because its not. I have a scrollView and pageControl on my MainWindow, and the scroll view subviews are loaded from xibs. Consequently, do i need to chang...