Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 未在横向模式下播放视频(xcode 4.2)_Iphone_Objective C_Ios_Xcode_Sdk - Fatal编程技术网

Iphone 未在横向模式下播放视频(xcode 4.2)

Iphone 未在横向模式下播放视频(xcode 4.2),iphone,objective-c,ios,xcode,sdk,Iphone,Objective C,Ios,Xcode,Sdk,未在lanscape模式下播放的视频尝试此代码返回YES;在方向仍然没有在lanscape模式下播放这是我正在使用的代码 在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_ce

未在lanscape模式下播放的视频尝试此代码返回YES;在方向仍然没有在lanscape模式下播放这是我正在使用的代码 在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

您的shouldAutorotateToInterfaceOrientation方法应该返回YES,而不仅仅是纵向

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

更改后,视频以横向方式播放,而不是以全横向方式播放。视频仅在屏幕左下角播放,其余部分为方形黑色