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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:22:09+00:00 2026-05-20T10:22:09+00:00

I am trying to create a table view which has a layout like what

  • 0

I am trying to create a table view which has a layout like what yobongo has:
enter image description here

and what I have now is really crappy, where the UIImage has different size, etc, etc…
How do I fix it to have something nice like that? I tried rearranging via IB but then mine looks like this:
enter image description here

I wanted to create a UIImage in the cell that has a fixed size (mine resizes here and there). How do I set that? I also want a rounded edge around the UIIMage… I have played around with the spring and struts via IB and I think I might have messed up something that I can’t fix again..

I also want so that there exists a gap between rows and a border like in the picture below

I also wanted to implement a chat box like below where it expands if the text is more than it’s limit. How can I do this?

  • 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-20T10:22:09+00:00Added an answer on May 20, 2026 at 10:22 am

    Fixed image size

    You have to set UIImageView frame for all image views. And then you have to play with UIImageView’s contentMode property – where you can scale image to fit frame, fill frame, keep aspect ratio, etc. And you also have to set clipsToBounds to YES to clip “overlapping” image parts.

    Round Corners

    You can use CALayer for this, which is also available in UIImageView. It’s matter of four lines …

    imageView.layer.cornerRadius = 3.0;
    imageView.layer.masksToBounds = YES;
    imageView.layer.borderColor = [UIColor blackColor].CGColor;
    imageView.layer.borderWidth = 1.0;
    

    Example:

    - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
      self = [super initWithStyle:style reuseIdentifier];
      if ( self ) {
        ...
        self.imageView.layer.cornerRadius = 3.0;
        self.imageView.layer.masksToBounds = YES;
        self.imageView.layer.borderColor = [UIColor blackColor].CGColor;
        self.imageView.layer.borderWidth = 1.0;
        ...
      }
      return self;
    }
    

    Expandable Text Input

    You have to prepare good background image for this. And then you can create stretchable image via UIImage class method: – stretchableImageWithLeftCapWidth:topCapHeight:

    Each row will be subclassed UITableViewCell where you can handle all these things. Stretchable background, etc. Resizing via UITextView’s delegate (textViewDidChange:), etc.

    Google for some examples or search SO.

    Gaps

    UITableViewDelegate has method …

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    

    … where you can specify row height. To create gap, add this to your custom cell …

    Header:

    UIImageView *__backgroundImageView;
    

    Initializer:

    __backgroundImageView = [[UIImageView alloc] initWithImage:...stretchableImage...];
    [self.contentView addSubview:__backgroundImageView];
    [self.contentView sendSubviewToBack:__backgroundImageView];
    

    Layouting:

    - (void)layoutSubviews {
      [super layoutSubviews];
    
      // This draws background image over the whole cell and adds 5px gap top/bottom
      CGRect rect = self.contentView.bounds;
      rect.origin.y += 5; // Draw background image 5 pixels below cell top
      rect.size.height -= 2 * 5; // Remove top/bottom gap from background image height
      __backgroundImageView.frame = rect;
    
      ...
    }
    

    Memory Management:

    - (void)dealloc {
      [super dealloc];
      [__backgroundImageView release]; __backgroundImage = nil;
      ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a Users table that only has OpenId registrations, exactly like
In a MVC project am trying to create a view which has the Title
I'm trying to create an XML sitemap using CakePHP, from a table which has
I'm new to Xcode and I'm trying to create an app which has a
I am trying to create a table with the following: CREATE TABLE GTW_WORKFLOW_MON (
I'm trying to create a table with two columns comprising the primary key in
I am trying to create a column in a table that's a foreign key,
I'm trying to create and retrieve a BLOB in a MySQL table via Kohana's
I'm trying to create a jqgrid, but the table is empty. The table renders,
Using Prototype 1.6's new Element(...) I am trying to create a <table> element with

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.