uikit

UIImage from photo library very large

Hi everyone! In my game I'm grabbing an image from the iPhone's photo library using the UIImagePickerController, which returns a UIImage. Because the image is a huge resolution (1536x2048), this UIImage takes up almost 20mb in memory. To resolve this, I shrink the image significantly before using it to generate a sprite and this works i...

Windows Phone 7 UI (Metro) possible on iOS?

How hard would be be to recreate Windows Phone 7 UI animations on an iOS device using UIKit? More specifically, making animated boxes gradually move from side-to-side, and appear in a chained manner. For example, windows phone 7 transitions here: http://www.youtube.com/watch?v=EUeNCzRhhDE At 0:30 - the parallax scrolling effect (relati...

How to disable the fields in settings in iphone based on other setting?

On an iPhone, when you go to Settings > Nike + iPod, in the app's settings, when you set Nike+iPod to off, it disables the rest of the settings. How do I do that? How do I disable the other setting depending on the value selected in ToggleSwitchSpecifier? Can we do it using Setting.Bundle? Or do we have to use preference.Bundle? Can we u...

Programmatically getting the "Z" position of a UIView compared to it's siblings

My class has logic for inserting views in certain levels in the hierarchy. containerView = [[UIView alloc] init]; shadowView = [[UIView alloc] init]; contentView = [[UIView alloc init]; [containerView addSubview:shadowView]; [containerView insertSubview:contentView belowSubview:shadowView]; Later down the line, it flips them so the sh...

Creating iOS UI components from NUnit test code

I'm trying to write a unit test for some code that programmatically creates UIButtons, but when I call this code from the test, I get a NullReferenceException. Stepping through in the debugger, it looks like UIButton.FromType() returns null. Here's the method I'm testing: public UIButton makeButton (String title, Action<IWelcomeCon...

view not updating, but everything on main thread (iOS)

I'm trying to show a UIProgressView on top of a table view after certain user interactions. In my table view, if the user taps one particular cell, I slide up a UIView that contains a toolbar with bar items and a picker view (it very much behaves like an action sheet). When I do this, I'm adding the view offscreen to the current view, ...

UIKit keys missing in info.plist file

Hi, I want to add UIApplicationExitsOnSuspend key in info.plist file but all the UI related keys are missing. What should be done to get UI related keys in info.plist file I have default frameworks uikit, foundation and coregraphics added to my project. ...

how to implement picker for a large amount of values

I have about 20,000 records (coming from an SQLite db) that I need to present to the user for possible choices, so conventional picker control is out of question. Another possibility could be an indexed UITableView where user could check the desired value, however keeping all the 20K records in the memory doesn’t seem like a good idea. ...

UIScrollView with UIButton doesn't scroll when touch down on button

Hi, I've got a UIScrollView in my UIView. I've added some UIButtons to the scroll view. If I touch down not on a button and drag, the scroll view drags fine. If I touch down on a button and drag then the scroll view doesn't move. I want the scroll view to always scroll around if dragged and the buttons only get selected on the Touch U...

UINavigationController Title not Applied

Hello, I am wondering why my UINavigationController is not letting me set a title. It lets me change the tint of the navigationBar, but the title and rightBarButtonItem I set just get ignored. Why? Here's my code: taps = 0; UIView*controllerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; controllerView.backgr...

UIButton event 'Touch Up Inside' not working. 'Touch Down' works fine.

Hi, I've got a UIButton in a UIView, which is in a UIViewController that I've allocated and inited from a .xib file. When hooking an IBAction up to the 'Touch Down' event of a UIButton it triggers correctly. But if I hook it up to the 'Touch Up Inside' event it doesn't respond. Other events don't work either. 'Touch Drag Enter', 'Tou...

iPad status bar overlaps view

In my iPad application, I have a 768x30 px view i place just below the status bar with coordinates (0,0). The status bar is also fully visible. When the app launches the status bar overlaps the view, so the view appears under the status bar. I am creating the view in Interface builder and it also appears correctly on there. The view app...

Is there any other way than @2x to let iOS know that the graphic is Retina Display ready?

I have a web service producing two versions of graphics; one for Normal Display and another for Retina Display. Unfortunately I can't add the @2x to the filename since I don't have access to that code. Is there any way to let the iPhone know that what's loading from the web is a @2x graphic? ...

iPhone Core Animation not Running Smoothly ?

Hi all, I have the following core animation code in my app : -(void)startCoreAnimation [UIView beginAnimations:@"IconFade" context:Icon]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [UIView setAnimationDuration:1]; [UIView setAnimationRepeatAutoreverses:YES]; [UIView setAnimationDelegate:self]; [UIView ...

How to add a NavigationViewController to a project created using the ViewController Template

I have created a new application using the View Based Application Template in xCode. My first view, which displays on loading the app, is a button based menu. One of the buttons (Make) should load a new navigation stack using a NavigationViewController. There are other buttons that when implemented will do other things outside of Navig...

How to find out if the back-button was tapped in the UINavigationBar?

Firstly I have tried to manage it with the viewWillDisapper-method, but this not detailed enough for me. Is their an other solution? Also tried the delegate: - (void)navigationBar:(UINavigationBar *)navigationBar didPushItem:(UINavigationItem *)item but nothing happens. ...

How to scale up an UIImage without smoothening anything?

I want to scale up an UIImage in such a way, that the user can see the pixels in the UIImage very sharp. When I put that to an UIImageView and scale the transform matrix up, the UIImage appears antialiased and smoothed. Is there a way to render in a bigger bitmap context by simply repeating every row and every column to get bigger pixel...

Why is my CGGradient not working with a preset UIColor?

I have this working code: NSMutableArray *shadowColors = [NSMutableArray arrayWithCapacity:2]; color = [UIColor colorWithRed:0 green:0 blue:0 alpha:1]; // Declaration using components [shadowColors addObject:(id)[color CGColor]]; color = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.0]; // Declaration using components ...

How to enable Data Detectors in a (sometimes-) editable UITextView

Does anyone know how the built-in Notes app manages to show data detectors and yet still have its UITextView editable? I've tried defaulting editable to NO (so the data detectors will work) then overriding UITextView's touches methods and setting it to YES, but it ends up scrolling to the bottom and I have to tap again to actually begin...

Decode images in background thread?

Hello! I have a background thread that loads images and displays them in the main thread. I noticed that the background thread has almost nothing to do, because the actual image decoding seems to be done in the main thread: So far I’ve tried calling [UIImage imageNamed:], [UIImage imageWithData:] and CGImageCreateWithJPEGDataProvider ...