55
votes
6answers
26k views
Rounded UIView using CALayers - only some corners - How?
In my application - there are four buttons named as follows.
Top - left
Bottom - left
Top - right
Bottom - right
Above this buttons there is an image view / or we can use also UIView.
Now, ...
46
votes
2answers
29k views
iOS Programming: Frame, Bounds and Center
I would like to know how to use these properties in the right manner.
As I Understand, frame can be used from the container of the view I am creating.
It sets the view position relative to the ...
23
votes
6answers
15k views
How Do I Take a Screen Shot of a UIView?
I am wondering how my iPhone app can take a screen shot of a specific UIView as a UIImage.
I tried this code but all I get is a blank image.
UIGraphicsBeginImageContext(CGSizeMake(320,480));
...
8
votes
5answers
11k views
Drawing incrementally in a UIView (iPhone)
As far as I have understood so far, every time I draw something in the drawRect: of a UIView, the whole context is erased and then redrawn.
So I have to do something like this to draw a series of ...
15
votes
5answers
27k views
“Application windows are expected to have a root view controller at the end of application launch” error only on iPad
I am trying to convert my iPhone only application to a Universal application. I switched the devices to Universal and let Xcode do it's thing making a MainWindow-iPad.xib for me, and now when I run ...
18
votes
5answers
7k views
How to draw a “speech bubble” on an iPhone?
I'm trying to get a "speech bubble" effect similar to the one in Mac OS X when you right click on something in the dock. Here's what I have now:
I need to get the "triangle" part of the lower ...
13
votes
6answers
15k views
How to implement an accordion view for an iPhone SDK app?
Has anyone seen an implementation of an "accordion" (maybe called "animated outline") view for the iPhone? I found an example project for Cocoa, but before trying a port, I was hoping that someone has ...
22
votes
12answers
20k views
How can I loop through all subviews of a UIView, and their subviews and their subviews
How can I loop through all subviews of a UIView, and their subviews and their subviews...
Thank you.
7
votes
2answers
3k views
UIScrollView Custom Paging
My question has to do with a custom form of paging which I am trying to do with a scroller, and this is easier to visualise if you first consider the type of scroll view implemented in a slot machine.
...
46
votes
3answers
39k views
How to add a touch event to a UIView?
How do I add a touch event to a UIView?
I try:
UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, nextY)] autorelease];
[headerView addTarget:self ...
14
votes
2answers
8k views
UIView autoresizingMask - Interface Builder to Code - Programmatically create struts and springs
I've laid out some subviews with Interface Builder, but I'd like to do it in code instead.
I've read the UIView docs about setting the view.autoresizingMask property. I'm looking for a logical ...
11
votes
2answers
21k views
How to get UIViewController of a UIView's superView in iPhone SDK?
I have a UIViewController in which i have a UITextView added from interface builder.Now i want to push a view when i click on hyperlink or phone number. I am able to detect that which url is clicked ...
13
votes
4answers
13k views
UIGestureRecognizer blocks subview for handling touch events
I'm trying to figure out how this is done the right way. I've tried to depict the situation in this image.
I'm adding a UITableView as a subview of a UIView. The UIView responds to a tap- and ...
3
votes
4answers
7k views
How to get a UIViewController from a UIView via code
There is a way to get a view controller reference from a UIView object? I need something like this:
MyParentViewController *myParentViewController = [self.view.superview controller];
Thanks in ...
0
votes
1answer
172 views
UIView Animation Inconsistent Result
I am trying to make use of UIView animation to slide my views across the screen. I have a UIScrollView in my view controller, in which I have my UIViews.
I alos have this method:
...