0

I make one tableview in which I add button type cell using custom cell. Looks good but when there is less cell in tableview at that time separator looks very bad. In design so there is any solution than tell me. I try to remove separator from design but it does not work.

- (void)viewDidLoad {
    self.navigationItem.title = @"My List";

    self.tblView.separatorStyle = UITableViewCellSeparatorStyleNone;

    [[self tableView] setRowHeight:70];
    [[self tableView] setBackgroundColor:[UIColor blackColor]];

    Helath_ndroidAppDelegate *appDeleg = (Helath_ndroidAppDelegate *)[[UIApplication sharedApplication] delegate];
     NSMutableArray *temp1 =[[NSMutableArray alloc] init];
     appDeleg.recipCategoryFromDatabase = temp1;
    [temp1 release];

    dataBase *objData = [[[dataBase alloc] init] autorelease];
    [objData selectrecepFromDatabase];



[[self tableView] setSeparatorStyle:UITableViewCellSeparatorStyleSingleLineEtched];

    [super viewDidLoad];
}
BenMorel
  • 34,448
  • 50
  • 182
  • 322
AJPatel
  • 2,291
  • 23
  • 42

1 Answers1

4

Have you tried to remove separator programmatically?
I use this code with my custom cells...
In your viewDidLoad method add this line of code if you are using an UITableViewController:

self.yourTableViewHere.separatorStyle = UITableViewCellSeparatorStyleNone;
matteodv
  • 3,992
  • 5
  • 39
  • 73
  • hey Matthew this code working on tableView....... but its not work on tableView when its on RootView Controller........... Thank lot for give me time buddy – AJPatel Dec 25 '10 at 10:04
  • happy chrismas...Matthew yes my app is navigation based thas y rootview controller cm buddy – AJPatel Dec 25 '10 at 10:08
  • I just created a Navigation Based app and I added this code in the viewDidLoad method and it works... Can you be more specific about your problem? – matteodv Dec 25 '10 at 10:11
  • why have you wrote self.tblView.separatorStyle instead of self.tableView.separatorStyle ? Is this only a typing error? However you can find some infos about the separator in this question: http://stackoverflow.com/questions/1374990/how-to-customize-tableview-seperator-in-iphone Hope it helps! – matteodv Dec 25 '10 at 10:19
  • Oh... If you want to remove the separator, you must delete this line of code in your viewDidLoad: [self tableView] setSeparatorStyle:UITableViewCellSeparatorStyleSingleLineEtched]; – matteodv Dec 25 '10 at 10:21
  • 1
    ;) An advice: why don't you accept answers in your questions? :) – matteodv Dec 25 '10 at 11:23
  • hey Matthew if u have time than give me answer of my this que NO. 4438343 on stackoverflow i use touch XML for parsing data – AJPatel Dec 27 '10 at 12:32
  • I'd like to help you but I never used XML to parse data and I don't know how to use it... I'm sorry ;) – matteodv Dec 27 '10 at 16:24