(Created page with 'right|framed|UICalloutView in action UICalloutView is a "callout" view which looks like a dialog box. It was used in MobileMaps.app. == Usi…') |
|||
(One intermediate revision by the same user not shown) | |||
Line 20: | Line 20: | ||
== UICalloutView delegate == | == UICalloutView delegate == | ||
{{Function signature|firmware=2.0 | {{Function signature|firmware=2.0 –|signature=@property(assign,nonatomic) id delegate;}} | ||
One could assign a delegate to a UICalloutView. The delegate must conform to the informal protocol: | One could assign a delegate to a UICalloutView. The delegate must conform to the informal protocol: | ||
Line 35: | Line 35: | ||
* The iPhone Developer's Cookbook by Erica Sadun, Chapter 8, Recipe: Adding Callout Views. ISBN 978-0321555458. | * The iPhone Developer's Cookbook by Erica Sadun, Chapter 8, Recipe: Adding Callout Views. ISBN 978-0321555458. | ||
{{occlass|library=UIKit.framework}} | {{occlass|library=UIKit.framework|navbox=on}} |
Latest revision as of 09:14, 22 November 2009
UICalloutView is a "callout" view which looks like a dialog box. It was used in MobileMaps.app.
Using UICalloutView
UICalloutView* callout = [UICalloutView sharedCalloutView];
[callout setTitle:@"Title"];
[callout setSubtitle:@"subtitle"];
[callout addTarget:self action:@selector(closeCalloutView:)];
[window addSubview:callout];
[callout setAnchorPoint:CGPointMake(80, 40) boundaryRect:[UIScreen mainScreen].applicationFrame animate:YES];
...
-(void)closeCalloutView:(UIButton*)sender {
[(UICalloutView*)sender.superview fadeOutWithDuration:1];
}
UICalloutView delegate
Signature | @property(assign,nonatomic) id delegate; |
---|---|
Available in | 2.0 – |
One could assign a delegate to a UICalloutView. The delegate must conform to the informal protocol:
@protocol UICalloutViewDelegate
@optional
-(void)calloutView:(UICalloutView*)calloutView willMoveToAnchorPoint:(CGPoint)newPoint animated:(BOOL)animated;
-(void)calloutView:(UICalloutView*)calloutView didMoveToAnchorPoint:(CGPoint)newPoint animated:(BOOL)animated;
@end
Reference
- Header: http://github.com/kennytm/iphone-private-frameworks/blob/master/UIKit/UICalloutView.h
- The iPhone Developer's Cookbook by Erica Sadun, Chapter 8, Recipe: Adding Callout Views. ISBN 978-0321555458.