Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9049395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:23:16+00:00 2026-06-16T12:23:16+00:00

iOS documentation says The UIImagePickerController class supports portrait mode only. Any alternatives to this

  • 0

iOS documentation says “The UIImagePickerController class supports portrait mode only”. Any alternatives to this if I want to display the photo library in landscape mode?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:23:17+00:00Added an answer on June 16, 2026 at 12:23 pm

    may be this will help you out .You can use ALAssetsLibrary and asset class to get the pictures in your device and you can use them to display in landscape mode and in portrait mode same like uiimagepicker.

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        [activity startAnimating];
    
    
        appObj=(ImagePickerAppDelegate *)[[UIApplication sharedApplication]delegate];
    
        void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop)
        {
            if(result != NULL) 
            {
                //assets is a mutualable array...for storing the images that are in the device..
                [assets addObject:result];
            }
        };
    
        void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) =  ^(ALAssetsGroup *group, BOOL *stop) 
        {
            if(group != nil)
            {
                [group enumerateAssetsUsingBlock:assetEnumerator];
            }
            //meth is a user defined method..   
            [self meth];
            [activity stopAnimating];
            [activity setHidden:YES];
        };
        assets = [[NSMutableArray alloc] init];
        ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
        [library enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:assetGroupEnumerator 
                             failureBlock: ^(NSError *error) { NSLog(@"Failure");}];
    }
    
    
    -(void)meth
    {
        NSLog(@"%i",[assets count]);
    
        if(userOrientation==UIInterfaceOrientationPortrait || userOrientation==UIInterfaceOrientationPortraitUpsideDown)
        {
            NSLog(@"haii");
            [scrollView removeFromSuperview];
    
            scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 320, 460)];
            scrollView.backgroundColor=[UIColor whiteColor];
    
            NSLog(@"%i",[assets count]);
            for (int i = 0; i < [assets count]; i++) 
            {
                imgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [imgBtn setFrame:CGRectMake((i%4*80)+2,(i/4*80)+2,75,75)];
                imgBtn.tag=i;
                [imgBtn addTarget:self action:@selector(imageClicked:) forControlEvents:UIControlEventTouchUpInside];
                ALAsset *asset=[assets objectAtIndex:i];
                [imgBtn setImage:[UIImage imageWithCGImage:[asset thumbnail]] forState:UIControlStateNormal];
                [scrollView addSubview:imgBtn];
            }
            scrollView.contentSize = CGSizeMake(320,(([assets count]/4)+1)*300 );
        }
    
        if(userOrientation==UIInterfaceOrientationLandscapeRight || userOrientation==UIInterfaceOrientationLandscapeLeft)
        {
            [scrollView removeFromSuperview];
            scrollView=[[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, 480,320)];
            for (int i = 0; i < [assets count]; i++) 
            {
                imgBtn = [UIButton buttonWithType:UIButtonTypeCustom];
                [imgBtn setFrame:CGRectMake((i%6*80)+2,(i/6*80)+2,75,75)];
                imgBtn.tag=i;
                [imgBtn addTarget:self action:@selector(imageClicked:) forControlEvents:UIControlEventTouchUpInside];
                ALAsset *asset=[assets objectAtIndex:i];
                [imgBtn setImage:[UIImage imageWithCGImage:[asset thumbnail]] forState:UIControlStateNormal];
                [scrollView addSubview:imgBtn];
            }
            scrollView.contentSize = CGSizeMake(480,(([assets count]/4)+1)*300);
        }
        [self.view addSubview:scrollView];
    }
    
    
    
    -(void)imageClicked:(UIButton *)sender
    {
        //for picking the images that the user has selected we are using other array "selectedImages" i.e declared in the app delegate
        ALAsset *asset=[assets objectAtIndex:sender.tag];
        [appObj.selectedImages addObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage]]];
        NSLog(@"%i",[appObj.selectedImages count]);
        [self.navigationController popViewControllerAnimated:YES ];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In this link it says it does: http://developer.apple.com/library/ios/#documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html However I have searched for an
The iOS documentation says that your view controllers should release (and nil, since that's
iOS documention says, that the UIWebView class conforms to UIScrollViewDelegate. But an UIWebView instance
What iOS framework contains CGImageRelease? The documentation says it is in ApplicationFramework, but I
This is what the documentation says: If the first responder [to an event or
I have installed the iOS documentation in XCode 4, but I don't want the
The Apple developer documentation says mouseout event is supported on IOS; http://developer.apple.com/library/iOS/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html But I
This is a stupid question. The documentation says: To enable debugging using Guard Malloc,
I need a save way to say: iOS, I want this method to be
Apple's documentation says ARC applications will run on iOS 4.0 or newer. Will an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.