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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:04:08+00:00 2026-05-30T01:04:08+00:00

I have a UITableView within a UIScrollView. It took me quite a lot of

  • 0

I have a UITableView within a UIScrollView. It took me quite a lot of work to make it work.

The tableView is 640×350, I use the scroll view to scroll from one end of the cell to the next.
The scroll view is 320×350.
The scroll view’s content size is 640×350

I’m running into this problem:
if I set scrollView’s minimum zoom scale to 0.5, the tableview’s width now fills the screen, but it’s height is only half the screen. I would like the tableview to show more rows when I zoom out to 0.5.

First of all I would like to understand if this is the correct behavior, or the result of my tableView’s content size and frame manipulations. The tableview has all springs and struts set in interface builder and should fill the frame available. This is my first attempt at zooming in months, and I don’t remember how it works with zooming.

Can someone help me understand where and what do I need to adjust?

As far as I understand, I need to put the code into scrollViewDidZoom: that will manipulate the tableView’s frame and content size.

PS. I”m returning the tableview from the viewForZooming: method of UIScrollView

  • 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-30T01:04:09+00:00Added an answer on May 30, 2026 at 1:04 am

    What you are trying to achieve is pretty hard.

    Solution 1 This solution uses the exact setup you have (UITableView inside UIScrollView).

    You say that when you set the zoomScale to 0.5, you want your table view to fill the scrollView vertically. At 0.5, your table view must be 640×700 in order to fill the UIScrollView as you wish. For this to happen, on scrollViewDidZoom: you must resize the frame of the table view to 640×700

    
    - (void)scrollViewDidZoom:(UIScrollView *)scrollView
    {
        // No matter what the zoomScale is, the tableView will be zoomed accordingly
        // Only zoom the height of the table
        tableView.frame = CGRectMake(0, 0, 640, 350 / zoomScale);
    
        // Also, update the contentSize
        scrollView.contentSize = CGSizeMake(640, 350 / zoomScale);
    }
    

    If you run the code above for zoomScale = 0.5 you will get a frame size of 640×700.

    This only changes the frame of the table and doesn’t change the heights of the cells. This means that as you zoom out, you will also see more cells in the tableview.

    Solution 2 Use only UITableView

    UITableView is a subclass of UIScrollView. This means it has the ability to zoom and scroll around.

    Start with a UITableView with the size that you want on the screen. Then, after the content is loaded modify the contentSize and make it wider than your frame width. This should enable horizontal scrolling.

    However, UITableViewCells have their frame set automatically to the width of the tableview frame. You can bypass this by using a custom UITableViewCell, with clipsToBounds=false. Inside it you will insert a UIView with the frame set to the width&height you desire and with no autoresizingMask. When the tableview will resize UITableViewCell frame, this will not affect your inner UIView.

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

Sidebar

Related Questions

I have a UIViewController, and within that view i have UITableView added in IB
I have a custom view MyView : UIViewController <UITableViewDelegate, UITableViewDataSource> with a UITableView within
I have a UIScrollView contained within a custom UIView with a content size larger
alt text http://img179.imageshack.us/img179/2047/iphonetableview.png I have a UITableView within a nib file. It works perfectly
I have a very strange problem with a UITableview within a navigation controller on
i have a UITableView , within each cell i have 2 custom buttons, what
I have a UITableView that loads remote data from the network. I have logic
I'm using storyboard to create a grouped UITableView . Within the table I have
If I have a uitableview within a uitableview (yes the cells of the toplevel
I have a UITableView, displayed within a UINavigationController. I'm trying to change the color

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.