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

  • Home
  • SEARCH
  • 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 6118783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:28:35+00:00 2026-05-23T15:28:35+00:00

@implementation MainViewController @synthesize scrollView,imageView; – (id) init { if (self != nil) { self.title

  • 0
@implementation MainViewController

@synthesize scrollView,imageView;

    - (id) init { 


    if (self != nil) {
        self.title = @"Evolution";
    }
    return self;}
    - (void)viewDidLoad {
    UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapDetected:)];
    tapGesture.numberOfTapsRequired = 1;
    tapGesture.numberOfTouchesRequired = 1;


    scrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];

    int numberOfImages = 32;
    CGFloat currentX = 0.0f;

    for (int i=1; i <= numberOfImages; i++) {

        // create image
        NSString *imageName = [NSString stringWithFormat:@"page-%d.jpg", i];
        UIImage *image = [UIImage imageNamed:imageName];
        imageView = [[UIImageView alloc] initWithImage:image];

        // put image on correct position
        CGRect rect = imageView.frame;
        rect.origin.x = currentX;
        imageView.frame = rect;

        // update currentX
        currentX +=454; //mageView.frame.size.width;

        [scrollView addSubview:imageView];
        [imageView release];
    }
    [scrollView addGestureRecognizer:tapGesture];

    scrollView.contentSize = CGSizeMake(currentX, 800);
    scrollView.pagingEnabled=YES;
    scrollView.userInteractionEnabled = YES;
    scrollView.maximumZoomScale = 15;
    scrollView.minimumZoomScale = 0.5;
    scrollView.bounces = NO;
    scrollView.bouncesZoom = NO;
    scrollView.delegate = self;

    scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
    [self.view addSubview:scrollView];
    [scrollView release];
    [super viewDidLoad];}
     - (BOOL)shouldAutorotateToInterfaceOrientation(UIInterfaceOrientation)interfaceOrientation{
    return YES;}

    -(void)tapDetected:(UIGestureRecognizer*)recognizer{

        ImageViewController *settings = [[ImageViewController alloc] init];
    [self.navigationController pushViewController:settings animated:YES];

    [settings release];}

@end

@implementation ImgScrollViewAppDelegate

    @synthesize window;@synthesize viewController;
    - (void)applicationDidFinishLaunching:(UIApplication *)application{
    LogMethod();
    // If you want the status bar to be hidden at launch use this:
    // application.statusBarHidden = YES;
    //
    // To set the status bar as black, use the following:
    // application.statusBarStyle = UIStatusBarStyleBlackOpaque;


    // Create window
    window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    // this helps in debugging, so that you know "exactly" where your views are placed;
    // if you see "red", you are looking at the bare window, otherwise use black
    // window.backgroundColor = [UIColor redColor];

    viewController = [ [ MainViewController alloc ] init ];

    navigationController = [ [ UINavigationController alloc ] initWithRootViewController: viewController ];

    /* Anchor the view to the window */
    [window addSubview:[navigationController view]];

    /* Make the window key and visible */
    [window makeKeyAndVisible];
} 
@end

in above code i have problem that is when check it on simulator then rotate device left and right. But view not change and i want to change it. how i modify it?

  • 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-05-23T15:28:36+00:00Added an answer on May 23, 2026 at 3:28 pm

    In your view controller implementation there is a method - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation. If you want it to rotate to any orientation, make it return YES. If you only want it to autorotate to some orientations, add an if statement to check and return yes or no.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

@implementation TestClass - (id) init { string = [[NSString alloc] init]; return self; }
The implementation of my view is below. scrollView is an iVar of type UIScrollView.
in my MainViewController implementation, I need to access variables from two different classes. one
Handler Implementation class TestHandler(RequestHandler, Jinja2Mixin): def get(self): channel_id = str(random.randint(1, 10000)) + str(datetime.now()) chat_token
The implementation used where I work uses about 10 columns in the table: CUSTOMFIELD1,
My implementation of Sieve of Atkin either overlooks primes near the limit or composites
What is a good implementation of a IsLeapYear function in VBA? Edit: I ran
I've created an implementation of the QAbstractListModel class in Qt Jambi 4.4 and am
.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0,
Do you know any implementation / technique which would provide similar behavior as Viewstate

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.