When you try deleting a note in iPhone's Notes application, an UIActionSheet pops up. The sheet is translucent (but not black translucent). How is that achieved? Is it possible to make the background of UIActionSheet a certain color?
...
The CA Programming Guide is talking about Constraints Layout Managers. However, the CALayer in the iPhone SDK doesn't have any constraints property or addConstraint method.
They say iPhone OS just doesnt provide custom layout managers. But how about the standard ones?
...
I'm having trouble setting up a model object to save the visual state of user generated CALayers in a simple graphics application for the iphone.
I'm attempting to save the background color and frame of all the current layers on screen by passing those properties to model objects which implement the NSCoding protocol and then into an NS...
While an UIView has a memory footprint of at least 4 * width * height pixels, I wonder how that would look when I create a CALayer only.
...
I have a UITableViewController and I want to add a navigation bar to it. So after the navigation bar (which works fine), part of the original tableView is being covered up by the nav bar.
I tried to reposition the table view using this:
self.tableView.frame = CGRectMake(0, 44 + 20 /* height of navbar + some margin */, 320, 416);
But ...
When and how is layoutIfNeeded used? I know that when we change the layout of a view, we can call setNeedsLayout to update the layout but not sure when layoutIfNeeded should be used.
NOTE: I have layoutIfNeeded used in actual code but forgot in what context it was used.
...
I have a view controller (let's call it MainViewController) that contains a UITabBarController, where each TabBarItem connecting to its respective UIViewController-derived classes. For certain UIViewControllers, I want to pass in value at the time via MainViewController. What's the best way to do this proxy'ing?
Right now, I end up ha...
I need to keep track of the previously selected segment of a UISegmentControl. Is there a delegate method I could use? Maybe something like selectedSegmentShouldChange:? The only delegate method I have been able to find is segmentedControl:selectedSegmentChanged:. This delegate is one step after the one I need.
...
Aside from using URL scheme, what other means are there for two iPhone apps to pass data between each other (ideally, without launching another app -- which is one of the downsides using URL scheme)
...
I have a table view and after I turned on the editing and re-ordered one of the cells, all cells would go back to normal, but the cell I moved remain in editing mode. Any idea why and how to fix this?
...
Hi, I'm currently trying to add a table view to my view hierarchy and am experiencing strange behaviour. The TableView seems to animate from a CGRectZero to its frame, visually seeming to spill onto the page. I am initializing with a frame of {{0,0},{320,367}}, which I have confirmed by Logging out to the console.
This could be a nice e...
I would like to trace out all messages sent by the Objective-C runtime to a particular class, say UITableView (or a particular instance) so I can better understand the inner workings of some classes. Is there a way to do this?
Another use case is to trace out all delegate methods that are being called (say UITableViewDelegate methods) ...
I am running into some odd issues with reordering table view cell. After reordering and clicking done (i.e. setEditing = false on the table view), one of the table view cells would always remain in editing mode while the rest reset back to normal (usually the one in close proximity to where the cell is moved from or to).
After some car...
Hi there!
Does anyone know how to create a text field that has a UIImage background and does word-wrapping?
It appears that word-wrapping is not available on UITextField, while a background image is not available for UITextView! Also, it should change the size of the control or at least alert that the number of lines changed so that a ...
I am using a tab bar (UITabBarController) on my app and I wish to have more than 20 different views to choose from.
If there are more than 5, "More" menu appears. I can access any of my views from "More" menu but I have problems with customizing my TabBar with "Configure" (Edit) navigation bar. I can see only 20 first view icons and I ...
I've been looking at the way resiznig works in Cocoa Touch and it looks like without writing any code, a UIView cannot be set up to size itself based on the size of it's children. There are plenty of options to resize and re-position child views when their containing view changes size, but nothing that works the other way round as far as...
Hey guys,
I have a table view which I'm using for some settings in my app. The tables cells are all default (no customisation at all), and simply contain some text for their label and a UISwitch for the accessory view.
My problem is that I need a reference to the switch so that I know when it has been switched on and off.
Currently I ...
Right now, I do most of my cleanup work in dealloc (cleaning up IBOutlets, allocated objects, etc.). What other places should I do cleanup work in order for my app to be a well-behaved one? Could you explain the things that are typically done in those methods as well?
For example, viewDidUnload, applicationWillResignActive, etc.
...
Hi
I have a UIImageView object that is just a plain black rectangle.
This is what i use to select a button in the view.
Problem is, I have 49 of these buttons in my view, and all of them can be selected at the same time.
What I use for adding a subview to a button is:
UIImageView* selectedSquareView = [[UIImageView alloc] initWithFra...
So using this link:
http://stackoverflow.com/questions/805872/how-do-i-draw-a-shadow-under-a-uiview
And this link:
http://iphonedevelopment.blogspot.com/2008/11/creating-transparent-uiviews-rounded.html
I came upon this implementation:
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSav...