uiview

UIView beginAnimations working in one Class but not another.

This has me really confused. I'm working on a custom animation for rotating an image inside a custom UITableViewCell. This all works fine when I place the code inside the same class as I'm calling it from, but fails if I put the code in it's parent. So at the moment I have two classes defined as @interface DummyEvent : Event @inte...

How to keep the previous drawing when using Quartz on the iPhone?

I want to draw a simple line on the iPhone by touching and dragging across the screen. I managed to do that by subclassing UIView and change the default drawRect: method. At the same time in my viewcontroller I detect the touch event and call the [myView setNeedsDisplay] when necessary. The problem is that when I try to draw the second l...

rotate uiview using touch (ipad and iphone)

Hi guys.. I am trying to design another app and am struggling to think of the best way to do it. I'm after some advice please! If you imaging a bicycle wheel in the middle of the ipad (and iPhone)... I want the user to be able to click on the tyre and spin it to the left or right. Depending on the speed of the swish will drive the speed...

How can I force a UILabel to cover the background of its parent UIView?

I'm having a problem I most definitely don't understand. I have the following subclass of UIView: @implementation TimelineSystemEventView - (id)initWithFrame:(CGRect)frame { if ((self = [super initWithFrame:frame])) { CGRect newFr = CGRectMake(-30, 0, 60, 25); label = [[UILabel alloc] initWithFrame:newFr]; [self addS...

xib-specified location moves on UIView load?

I have a couple of view controllers that I want all to share a header status bar. This header view shows status of certain things in my app. I used IB to lay out the contents of the header view in its own xib, then also used IB to layout the view controllers, adding a placeholder UIView element in the view controller's xibs for when I lo...

replace current view with any existing new view

Hi. In short I would like to call a method from a viewSwitchManager class that contains a method which would switch the current view on display to a different view. -(void)replaceView:(UIView*)oldSubView withView:(UIView*)newSubView; I am trying to implement the following: In my project I have 10 views they all have their own .m and...

UI freeze with animated removal of UIScrollView subview

In my iPhone app I have a UIScrollView with custom content views. At some points, a custom popup view is dynamically added to the content with a zoom animation on appear and disappear. I'm using block-based animations with a completion handler that calls [self removeFromSuperView] as follows: - (void)dismissPopup { CGRect rect = sel...

distorted UIView view on load

I have a UIScrollView that contains a UIView onto which I am drawing a rather complex graphic using CGPaths. After the view finishes loading the graphic is distorted in that it is elongated horizontally and vertically. If I redraw it, it looks normal. Any ideas on what is causing this and how to fix it? ...

UIView orientation is incorrect after the first draw.

I have a view controller that alternates 2 views on every touch. Each of the views overrides the drawRect function. It works when the iPad is in portrait position but for landscape position, the view is shown in the right orientation only once. After that they always appear in portrait orientation. What's wrong? In ViewController: -...

iOS - forward all touches through a view

I have an view overlayed on top of many other views. I am only using the overaly to detect some number of touches on the screen, but other than that I don't want the view to stop the behavior of other views underneath, which are scrollviews, etc. How can I forward all the touches through this overlay view? It is a subcalss of UIView. ...

Why is a UIButton is overriding UITapGestureRecognizer?

I have a parent UIView with 2 subviews: a UIButton and a UIScrollView with a UITapGestureRecognizer implemented. The UITapGestureRecognizer is used to zoom in and out the scrollview and the button is used to show/hide some text. My problem is that once I've used the UIButton, the UITapGestureRecognizer is no longer functioning. Also, t...

Objective-C's UIView and animationIDs

What are all the valid animationID strings for the beginAnimations:: class method on UIView? ...

Animating UIButtons

I have a few buttons I would like to animate. I have looked at and tried the animateWithDuration method but that seems to be for Views and I couldnt get my implementation to work. Can this method work for animating buttons too? if not how could it be done? EDIT I have the following code -(void) animate:(UIButton*) b withMonster: (...

Why is my UIView category causing warnings?

I added a category to UIView to hold some transition helper methods. The methods are all working; however, I get compiler warnings: warning: 'UIButton' may not respond to '-fadeOutWithDuration:' My "UIView+Trans.h" file looks like this: @interface UIImage (trans) - (void) fadeOutWithDuration:(CGFloat)duration; @end My "UIView+T...

Drag UIView between UIViews.

I have a UIView object X that is contained in an UIView object A. I want to be able to touch X and remove it from object A and move it into object B (another UIView). Both Object A & B are inside of the same super UIView. A B _____ _____ | | | | | X | -> | | |___| |___| This is what I have so far. @implementat...

UIImageView gets blurry after layer transformation

Hello guys! I have a UIImageView add to a UIView as a subview. When I apply a transformation on the UIView's layer the UIImageView gets blurry. Why is that? How can this problem be resolved? view.layer.position = newPosition; I apply only this transformation. Edit: I've tested it and if I apply other transformations like these: v...

Getting reference to the top-most view/window in iOS application.

I'm creating a reusable framework for displaying notifications in an iOS application. I'd like the notification views to be added over the top of everything else in the application, sort of like a UIAlertView. When I init the manager that listens for NSNotification events and adds views in response, I need to get a reference to the top-m...

iPhone SDK - How to disable the volume indicator view if the hardware buttons are pressed?

Is there any way to prevent the volume indicator view form showing if you press the volume up/down hardware bottons? It's needed for a demo app only. So the method don't need to be App Store safe. ...

Receiving errors when trying to draw with UIBezierPath

Hello, I'm trying to draw some lines inside my custom UIView. From what I can see, to save messing around with CoreGraphics, I can use UIBezierPath (i've done similar with NSBezierPath on the Mac). I have some code that tries to draw the lines but I get output errors and can't find a decent reference with some sample code to illustrate ...

UIView CGGradient clipped to drawn "frame"

Hi all! I'm trying to make a more sophisticated drawing of a UILabels (or a UIView, putting the UILabel on top, should that be required) background. Since I want this to resize automatically when the user changes iPhone orientation, I am trying to implement this in a subclasses drawRect function. I would love to be able to tune this all...