Tag: uikit

drawRect not being called in my subclass of UIImageView

I have subclassed UIImageView and tried to override drawRect so I could draw on top of the image using Quartz 2D. I know this is a dumb newbie question, but I’m not seeing what I did wrong. Here’s the interface: #import <UIKit/UIKit.h> @interface UIImageViewCustom : UIImageView { } – (void)drawRect:(CGRect)rect; @end And the implementation: #import […]

How can I delay a method call for 1 second?

Is there an easy way delay a method call for 1 second? I have a UIImageView that reacts on a touch event. When the touch is detected, some animations happen in the app. After one second, I want to call another method. In this case, I can’t use the animationDidStop selector.

Drop Shadow on UITextField text

Is it possible to add a shadow to the text in a UITextField?

How can I add CGPoint objects to an NSArray the easy way?

I have about 50 CGPoint objects that describe something like a “path”, and I want to add them to an NSArray. It’s going to be a method that will just return the corresponding CGPoint for an given index. I don’t want to create 50 variables like p1 = …; p2 = …, and so on. […]

Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

I’m using a UITableView to layout content ‘pages’. I’m using the headers of the table view to layout certain images etc. and I’d prefer it if they didn’t float but stayed static as they do when the style is set to UITableViewStyleGrouped. Other then using UITableViewStyleGrouped, is there a way to do this? I’d like […]

UIPageViewController returns no Gesture Recognizers in iOS 6

I am trying to disable the pan gesture recognizer for a UIPageViewController. On iOS 5 I can loop through them and disable them. for (UIGestureRecognizer* recognizer in self.pageViewController.gestureRecognizers) { if ([recognizer isKindOfClass:[UIPanGestureRecognizer class]]) { recognizer.enabled = NO; } } On iOS 6 using UIPageViewControllerTransitionStyleScroll there are no gesture recognizers returned by the Page View Controller. […]

Figure out UIBarButtonItem frame in window?

UIBarButtonItem does not extend UIView, so there is nothing like a frame property. But is there any way I can get what is it’s CGRect frame, relative to the application UIWindow?

Is there a way to remove the separator line from a UITableView?

I’m looking for a way to completely remove the separator line in a UITableView when in the plain mode. This is done automatically in grouped, but this also changes the dimensions of the table in a way that is hard to measure. I have set the seperator line color to colorClear. But this does not […]

Changing the background color of a UIAlertView?

I want to change the background color of my UIAlertView, but this doesn’t appear to have a color attribute.

How do I make UITableViewCell's ImageView a fixed size even when the image is smaller

I have a bunch of images I am using for cell’s image views, they are all no bigger than 50×50. e.g. 40×50, 50×32, 20×37 ….. When I load the table view, the text doesn’t line up because the width of the images varies. Also I would like small images to appear in the centre as […]