Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

MPMediaPickerController Orientation

rocotilosrocotilos Posts: 3,292iPhone Dev SDK Supporter, Registered Users @ @ @ @ @
edited June 2012 in iPhone SDK Development
Hi all

I've been searching (read: googling) since last night about MPMediaPickerController view orientation in landscape.

My ipad app is able to work in all orientation, but when I call
MPMediaPickerController, it is always presented in portrait orientation.

How do I make it follow the device orientation?

I tried:
mediaPicker.view.transform = CGAffineTransformMakeRotation(M_PI/2);
//or
mediaPicker.view.superView.transform = CGAffineTransformMakeRotation(M_PI/2);

Doesn't work.

Just found out the picker doesn't support landscape, but surely
there is a way to make it rotate right? I can't seem to get the view
of this controller and apply transform to it.

Thanks.
Post edited by rocotilos on
· ·

Replies

  • rocotilosrocotilos Posts: 3,292iPhone Dev SDK Supporter, Registered Users @ @ @ @ @
    edited June 2012
    This FORUM has MAGICAL POWERS.

    Right after I post this question, I continued to search and within minutes,
    I found the solution, here's my code now and it works.
    - (IBAction)showMediaPicker:(id)sender
    {
        
        MPMediaPickerController *mediaPicker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAny];
        
        mediaPicker.delegate = self;
        mediaPicker.allowsPickingMultipleItems = YES;
        mediaPicker.prompt = @"Select musics...";
        
       
        UIPopoverController *colorPickerPopover = [[[UIPopoverController alloc] 
                                        initWithContentViewController:mediaPicker] retain];               
        [colorPickerPopover presentPopoverFromBarButtonItem:sender 
                                        permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];    
        /*
        [self presentModalViewController:mediaPicker animated:YES];
        [mediaPicker release];
         */
    }
    
    

    This code is not optimized for memory or cleanups. Take care of that by yourself.
    · ·
Sign In or Register to comment.