小编dan*_*dan的帖子

如何设置shell脚本的进程名称?

有没有办法设置shell脚本的进程名称?使用killall命令杀死此脚本需要这样做.

shell scripting process

25
推荐指数
1
解决办法
3万
查看次数

iOS SDK - 如何在使用UIImagePickerController时恢复状态栏?

一旦我将UIImagePickerController子视图添加到我的视图中,状态栏就会消失,我无法将其恢复.有没有办法保持状态栏可见?

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;


[self.view addSubview:imagePicker.view];

[imagePicker viewWillAppear:YES];
[imagePicker viewDidAppear:YES];

[[UIApplication sharedApplication] setStatusBarHidden:NO animated:NO];
Run Code Online (Sandbox Code Playgroud)

iphone statusbar uiimagepickercontroller

22
推荐指数
3
解决办法
3万
查看次数

iPhone SDK 4 AVFoundation - 如何正确使用captureStillImageAsynchronouslyFromConnection?

我正在尝试使用新AVFoundation framework的iPhone拍摄静态照片.

按下按钮可以调用此方法.我可以听到快门声,但我看不到日志输出.如果我多次调用此方法,相机预览将冻结.

有没有任何教程如何使用captureStillImageAsynchronouslyFromConnection

[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:
                [[self stillImageOutput].connections objectAtIndex:0]
                     completionHandler:^(CMSampleBufferRef imageDataSampleBuffer,
                            NSError *error) {
                                              NSLog(@"inside");
                            }];
Run Code Online (Sandbox Code Playgroud)
- (void)initCapture {
    AVCaptureDeviceInput *captureInput = [AVCaptureDeviceInput 
                                          deviceInputWithDevice:[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo] 
                                          error:nil];

    AVCaptureVideoDataOutput *captureOutput = [[AVCaptureVideoDataOutput alloc] init];

    captureOutput.alwaysDiscardsLateVideoFrames = YES; 

    dispatch_queue_t queue;
    queue = dispatch_queue_create("cameraQueue", NULL);
    [captureOutput setSampleBufferDelegate:self queue:queue];
    dispatch_release(queue);

    NSString* key = (NSString*)kCVPixelBufferPixelFormatTypeKey; 
    NSNumber* value = [NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA]; 
    NSDictionary* videoSettings = [NSDictionary dictionaryWithObject:value forKey:key]; 
    [captureOutput setVideoSettings:videoSettings]; 

    self.captureSession = [[AVCaptureSession alloc] init];
    self.captureSession.sessionPreset = AVCaptureSessionPresetLow;

    [self.captureSession addInput:captureInput];
    [self.captureSession addOutput:captureOutput];

    self.prevLayer …

iphone camera avfoundation

21
推荐指数
3
解决办法
3万
查看次数

iPhone SDK 4 - 如何以编程方式检测音量硬件按钮?

如何检测用户是否按下音量硬件按钮并防止默认行为?

非常感谢.

hardware iphone volume button

5
推荐指数
1
解决办法
7461
查看次数

iPhone SDK - 如果按下硬件按钮,如何禁用音量指示器视图?

有没有办法阻止音量指示器视图窗体显示您是否按下音量增大/减小硬件按钮?

它仅用于演示应用程序.因此该方法不需要是App Store安全的.

iphone volume uiview

5
推荐指数
1
解决办法
4206
查看次数