自定义照相机
来源:互联网 发布:手机淘宝心级怎么看 编辑:程序博客网 时间:2024/04/20 02:27
#import <Foundation/Foundation.h>
@interface CustomerViewController : UIImagePickerController<UIImagePickerControllerDelegate,UINavigationControllerDelegate> {
UIToolbar *hortoolBar;
UIToolbar *vertoolBar;
}
@property (nonatomic,retain) UIToolbar *hortoolBar;
@property (nonatomic,retain) UIToolbar *vertoolBar;
-(void)setNewController;
@end
// Created by wgd on 12-5-3.
// Copyright 2012 __MyCompanyName__. All rights reserved.//
#import "CustomerViewController.h"
@implementation CustomerViewController
@synthesize hortoolBar,vertoolBar;
-(CustomerViewController *)init
{
[super init];
[self setNewController];
return self;
}
-(void)check:(id)sender
{
self.showsCameraControls = NO;
[self takePicture];
}
-(void)cancelTakePhoto:(id)sender
{
[self.delegate imagePickerControllerDidCancel:self];
}
-(void)setNewController
{
self.vertoolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 970, 768, 54)];
[self.view addSubview:vertoolBar];
UIBarButtonItem *btn1 = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonSystemItemCancel target:self action:@selector(cancelTakePhoto:)];
btn1.width = 100;
UIBarButtonItem *btn11 = [[UIBarButtonItem alloc] initWithTitle:@"" style:
UIBarButtonItemStylePlain target:self action:nil];
btn11.width = 530;
btn11.enabled = NO;
UIBarButtonItem *btn2= [[UIBarButtonItem alloc] initWithTitle:@"拍照" style: UIBarButtonSystemItemCancel target:self action:@selector(check:)];
// UIBarButtonItem *btn2= [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"test.png"] style:UIBarButtonSystemItemCancel target:self action:@selector(check:)];
btn2.width = 100;
NSMutableArray *btnArray = [[NSMutableArray alloc] initWithObjects:btn1,btn11,btn2,nil];
vertoolBar.items = btnArray;
[btn1 release];
[btn11 release];
[btn2 release];
UIBarButtonItem *btn3 = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonSystemItemCancel target:self action:@selector(cancelTakePhoto:)];
btn3.width = 100;
UIBarButtonItem *btn31 = [[UIBarButtonItem alloc] initWithTitle:@"" style:
UIBarButtonItemStylePlain target:self action:nil];
btn31.width = 790;
btn31.enabled = NO;
UIBarButtonItem *btn4= [[UIBarButtonItem alloc] initWithTitle:@"拍照" style:UIBarButtonSystemItemCancel target:self action:@selector(check:)];
btn4.width = 100;
NSMutableArray *btnArray2 = [[NSMutableArray alloc] initWithObjects:btn3,btn31,btn4,nil];
[btn3 release];
[btn31 release];
[btn4 release];
self.hortoolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 714, 1024, 54)];
hortoolBar.items = btnArray2;
[self.view addSubview:hortoolBar];
if(UIDeviceOrientationLandscapeRight == [UIDevice currentDevice].orientation
||UIDeviceOrientationLandscapeLeft == [UIDevice currentDevice].orientation
)
{
vertoolBar.hidden = YES;
hortoolBar.hidden = NO;
}
else
{
vertoolBar.hidden = NO;
hortoolBar.hidden = YES;
}
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return YES;
}
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if(UIDeviceOrientationLandscapeRight ==toInterfaceOrientation||
UIDeviceOrientationLandscapeLeft == toInterfaceOrientation)
{
vertoolBar.hidden = YES;
hortoolBar.hidden = NO;
}
else
{
hortoolBar.hidden = YES;
vertoolBar.hidden = NO;
}
}
-(void)dealloc
{
[vertoolBar release];
[vertoolBar release];
[super dealloc];
}
@end
- 自定义 照相机
- 自定义照相机
- 自定义照相机
- 自定义照相机拍照界面
- Android自定义照相机实现
- Android自定义照相机注意事项
- 自定义的照相机视图
- android 自定义照相机
- iOS自定义照相机
- 自定义照相机官方指南
- iOS 自定义照相机
- 自定义安卓照相机
- Android自定义简易照相机
- 简易的自定义照相机
- Android 自定义照相机
- 自定义照相机(一)
- android 自定义照相机Camera黑屏
- Android自定义照相机,手动聚焦
- 什么是云计算平台
- 二分查找
- PHP之星际设计模式下(转自lightsaber)
- 什么是移动云计算
- MyEclipse启动优化
- 自定义照相机
- 【LGame入门学堂007.控件篇】简单控件之Desktop
- 关于pl/sql语言的格式
- 真正的男人
- ccs
- google各项辅助业务全面落后
- 利用HTML组件.htc解决GridView鼠标经过及点击样式
- SSH+Xfire+Proxool开发框架整合(二)
- 局域共享解决