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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:54:49+00:00 2026-06-08T02:54:49+00:00

I have a grouped UITableView that was really designed to look nice in portrait

  • 0

I have a grouped UITableView that was really designed to look nice in portrait mode for iPhone. Its cell subviews have autosizing set up so that they stretch in landscape mode, but this makes it a lot less aesthetically pleasing — the cells just look too wide for their content.

I’m now making it a universal app but on iPad the autosizing causes even more stretching and it looks just unacceptable.

It would be ideal if I could make the UITableView’s groups of cells have a fixed width (or a max width), or if I could somehow control the horizontal margins.

Having not found support for this in UITableView, I have done a few quick attempts at subclassing it to constrain its size at layout time and, as an alternative, at introducing a container view in order to make the UITableView autoresize vertically only. Both approaches work but create new problems: Scrolling doesn’t work when swiping in the margins, and I am now forced to make the UITableView’s background transparent (which goes against Apple’s recommendations) as there is now a discontinuity of background between the UITableView’s frame and the margins.

Has anyone found a trick to solve my problem (i.e. constrain the width of the groups in a UITableView, causing margins to expand to fill the width of the view), or an open source solution to 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-06-08T02:54:51+00:00Added an answer on June 8, 2026 at 2:54 am

    Good news! I finally found a way to achieve this satisfactorily with only tiny code changes:

    • Shrink the cells by subclassing UITableViewCell and overriding -setFrame, as per the solution to this post:
      How to set the width of a cell in a UITableView in grouped style
    • And to add vertical padding, using the contentInset property of the UITableView (inherited from UIScrollView) works pretty well.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a grouped UITableView that has 3 sections. I would like to show
I have a grouped UITableView that contains several cells (just standard UITableViewCell s), all
I have a UITableView that is grouped into sections and has a number of
I have a UITableView that is styled as a grouped tableView. Under certain circumstances
In my iPhone app, I have a (non-grouped) UITableView which uses all the bells
I have a UItableView (grouped style). I wanted to customize it so that it
I have a standard, grouped UITableView that I am trying to add a custom
I have a grouped UITableView in my UIViewController class and I'm finding that at
Ok, I have a grouped TableView that has the following overridden method: -(NSIndexPath*)tableView:(UITableView *)tableView
I have a simple grouped table view that when a cell is selected it

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.