學習iPhone UIKit 9
1、動作表中的控制項;
- (void)buttonDidPush
{
UIActionSheet* sheet = [ [ [ UIActionSheet alloc ] init ] autorelease ];
sheet.delegate = self;
[ sheet addButtonWithTitle: @"action1" ];
[ sheet addButtonWithTitle: @"delete" ];
[ sheet addButtonWithTitle: @"cancel" ];
sheet.cancelButtonIndex = 2;
sheet.destructiveButtonIndex = 1;
[ sheet showInView: self.view ];
//如此也可實現相同的功能
// UIActionSheet* sheet2 = [ [ [ UIActionSheet alloc ] initWithTitle: nil delegate: self cancelButtonTitle:@"取消" destructiveButtonTitle: nil otherButtonTitles:@"action1",@"action2", nil ] autorelease ];
// [ sheet showInView: self.view ];
}
2、編輯菜單的顯示;
//
// LikMenu.h
// likTwoHelloWorld
//
// Created by apple on 13-1-31.
// Copyright 2013年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LikMenu : UIViewController {
@private
UILabel* label_;
CGPoint touchPoint_;
}
@end
3、畫面中圖片的複製、剪下、粘貼;
//
// UIKitPrjCopyAndPaste.h
// likTwoHelloWorld
//
// Created by apple on 13-1-31.
// Copyright 2013年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIKitPrjCopyAndPaste : UIViewController {
@private
CGPoint touchPoint_;
}
- (UIImageView*)imageContainsPoint:(CGPoint)point;
@end
4、使用相簿;
//
// LikImagePicker.h
// likTwoHelloWorld
//
// Created by apple on 13-1-31.
// Copyright 2013年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LikImagePicker : UIViewController <UINavigationControllerDelegate,UIImagePickerControllerDelegate>{
@private
UIImageView* imageView_;
}
@end
5、簡單的動作表;
#import <UIKit/UIKit.h>
@interface LikActionSheet : UIViewController
<UIActionSheetDelegate>
{
}
@end
//
// LikImagePicker.h
// likTwoHelloWorld
//
// Created by apple on 13-1-31.
// Copyright 2013年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LikImagePicker : UIViewController <UINavigationControllerDelegate,UIImagePickerControllerDelegate>{
@private
UIImageView* imageView_;
}
@end
6、使用網路攝影機;