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 6379041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:05:13+00:00 2026-05-25T02:05:13+00:00

My tableview has 4 cells, and each cells has one different picture as background.

  • 0

My tableview has 4 cells, and each cells has one different picture as background.

When I rotate the iPhone, the height of the rows change, and also the pictures.

Is really easy to change picture if the position is in landscape or in portrait, but the picture change when the iPhone is already rotated, not while is rotating!
What’s the problem?
For example: the iPhone is in portrait and the user rotates it in landscape.
That there is a very ugly effect, because the pictures change just when the iPhone is in landscape, and for a fraction of a second the user sees the portrait picture deformed (before that it changes).

How can I solve it?

Thanks

  • 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-25T02:05:14+00:00Added an answer on May 25, 2026 at 2:05 am

    The easy way:
    Implement willAnimateRotationToInterfaceOrientation in your view controller. Inside this method you can reorient your pictures and they’ll automatically be animated. There’s a short overview this and other available interface orientation methods at http://www.dizzey.com/development/ios/handling-layout-on-uiinterfaceorientation-change/

    Pointlessly difficult way:
    You could manually track acceleration and write your own animation blocks.
    Set your view controller as a UIAccelerometerDelegate. Reference the sharedAccelerometer as follows.

        accel = [UIAccelerometer sharedAccelerometer];
        accel.delegate = self;
        accel.updateInterval = 1.0f/60.0f;
    

    Then implement this delegate method. This will be run every time the accelerometer notices acceleration. Tracking acceleration in the X axis will give you landscape/portrait orientation.

    #pragma mark UIAccelerometer delegate method
    -(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration {
        if(acceleration.x > 0.8) //landscape right
        {
            [UIView beginAnimations:@"text spin" context:nil];
            [UIView setAnimationCurve:UIViewAnimationCurveLinear];
            [UIView setAnimationDuration:0.2];
            //do some animation to landscape right
            [UIView commitAnimations];
        }
        if(acceleration.x < -0.8) //landscape left
        {
            [UIView beginAnimations:@"text spin" context:nil];
            [UIView setAnimationCurve:UIViewAnimationCurveLinear];
            [UIView setAnimationDuration:0.2];      
            //do some animation to landscape left
            [UIView commitAnimations];
        }
        if(acceleration.x < 0.2 && acceleration.x > -0.2) //portrait 
        {
            [UIView beginAnimations:@"text spin" context:nil];
            [UIView setAnimationCurve:UIViewAnimationCurveLinear];
            [UIView setAnimationDuration:0.2];
            //do some animation to portrait view
            [UIView commitAnimations];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I added several cells to a tableview and each cell has a textField in
I have a tableView with custom cells in it, each cell has a UISlider
I have two UITableView, each one has a different delegate in the same UIViewController.
I have a tableView which has cells with phone numbers. The app is not
I have a tableView and when the user is selecting one of the cells,
Each of my table cells has a slider and a label to show its
I have a UITableView that has 3 sections. My individual cells vary in height
I have an array of dictionaries. Each dictionary has one category. I want to
I have a tableview with four sections first section has 7 rows in that
I have an app that has a TableView, NavigationView and TabBar running together. There

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.