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

The Archive Base Latest Questions

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

I have UITableView in my application. Attributes: TableStyle = Plain, SeperatorStyle = single and

  • 0

I have UITableView in my application.

Attributes: TableStyle = Plain, SeperatorStyle = single and SeperatorColor = black

What I want to do is that, I want to put a image (which a small strip), as separator for the table.

Please help me.

Regards,
Pratik

  • 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-13T16:25:52+00:00Added an answer on May 13, 2026 at 4:25 pm

    So, usually with an iPhone table, you should just use one of the built in styles: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableView/separatorStyle

    As an iPhone developer who has been down this road, I suggest you avoid images wherever possible, and use the API to build your app.

    If you insist on your reckless course, or if you have a client demanding this or something, then what you can do is subclass UITableViewCell.

    In your UITableViewCell subclass, you can add whatever UI elements you want to the contentView of the cell, including a separator image at the bottom of the cell.

    So, here is an implementation of the delegate function that returns a table cell using a custom UITableViewCell:

    - (UITableViewCell *)tableView:(UITableView *)tableView 
             cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
      static NSString *CellIdentifier = @"Cell";
    
      // notice I use a SavedTableCell here instead of a UITavbleViewCell
      SavedTableCell *cell = (SavedTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
      if (cell == nil) {
        cell = [[[SavedTableCell alloc] initWithReuseIdentifier:CellIdentifier hasIcon:YES] autorelease];
      }
    
      // custom function to set the fields in the cell
      [cell setItem:[self.items objectAtIndex:indexPath.row]];  
      return cell;
    }
    

    And then here’s my simplified implementation of SavedTableCell.h:

    #import <UIKit/UIKit.h>
    #import "Item.h"
    
    @interface SavedTableCell : UITableViewCell {
    
      // my cell has one label and one image, but yours would have an image placed at the bottom of the cell's frame
      UILabel *primaryLabel;
      UIImageView *icon;
    }
    
    // i just made up the class Item... in my code they are actually Waypoints.
    - (void) setItem:(Item*)item;
    
    
    @property(nonatomic,retain) UILabel *primaryLabel;
    @property(nonatomic,retain) UIImageView *icon;
    
    
    @end
    

    And here is a simplified SavedTableCell.m:

    #import "SavedTableCell.h"
    
    @implementation SavedTableCell
    
    @synthesize primaryLabel, icon;
    
    
    - (id)initWithReuseIdentifier:(NSString *)reuseIdentifier {
      if (self = [super initWithStyle:UITableViewStylePlain reuseIdentifier:reuseIdentifier]) {
        icon = [[UIImageView alloc] initWithFrame:CGRectMake(5,5,40,40)];
        [self.contentView addSubview:icon];
        primaryLabel = [[UILabel alloc]init];
    primaryLabel.font = TITLE_FONT;     
        [self.contentView addSubview:primaryLabel]; 
      } 
      return self;
    }
    
    
    - (void) setItem:(Item*)item {
      self.primaryLabel.text = [item name];
      [self.icon setImage:[item imageName]];
    }
    
    - (void)layoutSubviews {
      [super layoutSubviews];
      primaryLabel.frame = LABEL_FRAME;
      icon.frame = ICON_FRAME;  
    }
    
    - (void)dealloc {
      [icon release];
      [primaryLabel release];
    }
    
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an app I'm working on, I have a plain style UITableView that can
I have an application that uses a UITableView to present data that I have
I have a UITableView cell that is going to have a variable size depending
I have an array of objects which populate a UITableView . When a user
Currently I have a navigation based application and obviously the RootViewController is a UITableView.
I have an application based on CoreDataBooks. I want to toggle two images in
In my iPhone app, I have a (non-grouped) UITableView which uses all the bells
I have got an UITableView. How to simply fill it with three elements, for
I have a need to display a UITableView containing a user's account credentials. For
I have a UIView with a UITableView for a subview. The UIView has an

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.