2011-12-08 11 views
0

lanscape 모드로 재생되지 않는 비디오가이 코드를 사용했습니다. 반환 YES; 방향으로 여전히 lanscape에 모드에서 재생되지 이것은 내가 을 사용하고있는 코드는 비디오 엑스 코드에서 가로 모드에서 재생에 대한 서로 다른 코드가 4.2가로 모드로 비디오가 재생되지 않음 (xcode 4.2)

// 
// New_page.m 
// salah1 
// 
// Created by on 30/11/2011. 
// Copyright (c) 2011 j h . All rights reserved. 
// 

#import "New_page.h" 
#import "Custom_cell.h" 
#import "Mynewpage.h" 


@implementation New_page 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
{ 
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 
if (self) { 
    // Custom initialization 
} 
return self; 
} 

- (void)didReceiveMemoryWarning 
{ 
// Releases the view if it doesn't have a superview. 
[super didReceiveMemoryWarning]; 

// Release any cached data, images, etc that aren't in use. 
} 

#pragma mark - View lifecycle 

- (void)viewDidLoad 
{ 
mydata = [[NSMutableArray alloc]initWithObjects:@"When was salah made compulsory?",@"Al-  Mi'raj:The Alleged Ascent to Heaven",nil]; 
myaudio = [[NSMutableArray alloc]initWithObjects:@"Video1",@"2",nil]; 
[super viewDidLoad]; 
// Do any additional setup after loading the view from its nib. 
} 

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{ 
return 1; 
} 

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
return [mydata count]; 
} 

// Customize the appearance of table view cells. 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:  (NSIndexPath *)indexPath 
    { 
static NSString *CellIdentifier = @"Custom_cell"; 

Custom_cell *cell = (Custom_cell *) [tableView  dequeueReusableCellWithIdentifier:CellIdentifier]; 

if (indexPath.section == 0) { 

} 

if (cell == nil) { 

    NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"Custom_cell" owner:self options:nil]; 


    //cell = [[[Custom_cell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 

    for (id currentObject in topLevelObjects) 
    { 


     if ([currentObject isKindOfClass:[UITableViewCell class]]) 

     { 
      cell = (Custom_cell *) currentObject; 
      // cell.backgroundView.backgroundColor = [UIColor clearColor]; 
      break; 



     } 


    } 


} 

cell.lbl.text = [mydata objectAtIndex:indexPath.row]; 
return cell; 
// [myString release]; 
} 





- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath  *)indexPath 
{ 

Mynewpage *page = [[Mynewpage alloc]init]; 
page.urlname = [myaudio objectAtIndex:indexPath.row]; 
[self.navigationController pushViewController:page animated:YES]; 

} 




- (void)viewDidUnload 
{ 
[super viewDidUnload]; 
// Release any retained subviews of the main view. 
// e.g. self.myOutlet = nil; 
    } 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
// Return YES for supported orientations 
return (interfaceOrientation == UIInterfaceOrientationPortrait); 
} 

@end 

답변

0

은 shouldAutorotateToInterfaceOrientation 방법은 YES 대신에 반환해야합니다 단지 세로

에 대한
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
// Return YES for supported orientations 
return YES; 
} 
+0

변경 후 비디오는 가로로 재생되지만 전체 가로로는 재생되지 않습니다. 스크린의 왼쪽 하단 나머지 부분에서 비디오가 재생됩니다. – user1087659

관련 문제