小编Rav*_*avi的帖子

如何在iOS中的MPMoviePlayerViewController中禁用FullScreen

我正在和MPMoviePlayerViewController,

MPMoviePlayerViewController *avPlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
// [movieView prepareToPlay];

[avPlayer.view setFrame: CGRectMake(0, 200, 320, 100)];  // player's frame must match parent's
[avPlayer shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeRight];
[avPlayer shouldAutorotateToInterfaceOrientation:UIInterfaceOrientationLandscapeLeft];
avPlayer.moviePlayer.scalingMode=MPMovieScalingModeAspectFit;
avPlayer.moviePlayer.useApplicationAudioSession=NO;
avPlayer.moviePlayer.controlStyle=MPMovieControlStyleEmbedded;
//avPlayer.moviePlayer.repeatMode=MPMovieRepeatModeOne;
avPlayer.moviePlayer.scalingMode=MPMovieScalingModeFill;
[self.view addSubview: avPlayer.view];
Run Code Online (Sandbox Code Playgroud)

这个功能工作正常.但我需要禁用全屏MPMoviePlayerViewController.所以,我写的

avPlayer.moviePlayer.fullscreen=NO;
Run Code Online (Sandbox Code Playgroud)

但这不起作用.

请你给我一个建议.

iphone objective-c mpmovieplayercontroller ios

6
推荐指数
1
解决办法
5389
查看次数

如何使用日期查找Nakshatra和thithi

我需要使用日期时间和当前位置纬度和经度来计算NakshatraThithi.

来自的日期

    NSDate *today = [NSDate date];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
 // display in 12HR/24HR (i.e. 11:25PM or 23:25) format according to User Settings
    [dateFormatter setTimeStyle:NSDateFormatterShortStyle];
    NSString *currentTime = [dateFormatter stringFromDate:today];
    [dateFormatter release];
Run Code Online (Sandbox Code Playgroud)

经度和纬度值来自NSLocationManager.有人可以详细说明数学计算吗?

objective-c ipad ios

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

iOS 中的条码扫描器

我使用 AV Foundation 框架来实现条码扫描功能。

session = [[AVCaptureSession alloc] init];
device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
NSError *error = nil;

input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
if (input) {
    [session addInput:input];
} else {
    NSLog(@"Error: %@", error);
}

output = [[AVCaptureMetadataOutput alloc] init];
[output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
[session addOutput:output];

output.metadataObjectTypes = [output availableMetadataObjectTypes];

prevLayer = [AVCaptureVideoPreviewLayer layerWithSession:session];
prevLayer.frame = self.view.bounds;
Run Code Online (Sandbox Code Playgroud)

使用 delegete 方法我会得到条形码结果。即条形码编号

- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection
{
    CGRect highlightViewRect = CGRectZero;
    AVMetadataMachineReadableCodeObject *barCodeObject;
    NSString *detectionString = nil;
    NSArray *barCodeTypes = @[AVMetadataObjectTypeUPCECode, …
Run Code Online (Sandbox Code Playgroud)

objective-c avfoundation ios ios7

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