How to remove bounding (UITableView) grouped text boxes

The cells in my UITableView are grouped text boxes. When I run my code on the emulator, I get this:

Grouped text fields and button

As you can see, there is a gray area around the text boxes, and the background of the UITableView and the button are white. Is it possible to remove or make invisible a gray border (not a separator or border other than an area) around the grouped cells? If so, how can I do this?

Update. Background color works on iPhone but not iPad. I am working on an iPad.

I fixed the problem. Decision:

UIView *clearView = [[UIView alloc] initWithFrame:[myTableView bounds]];
clearView.backgroundColor = [UIColor clearColor];
myTableView.backgroundView = clearView;
[clearView release];

      

Since setting the background in the xib file doesn't work, I did it programmatically. Here myTableView

is a tableView object on xib. As you can see, I replaced the background view with a clear color (transparent) view. The desired effect is achieved.

+3


source to share


4 answers


If you mean tableview background color you can do it in nib

enter image description here

Clearing the background color simply means you have to know what's at the table - as you will see!



If you mean a border with a gray border, you must do it in code. So let's say the viewDidLoad method of the class that owns the table view.

self.tableView.separatorColor = [UIColor clearColor];

      

+6


source


Set the background color to a table to clear the color.

Like this



myTableView.backgroundColor = [UIColor clearColor];

myTableView.opaque = NO;
myTableView.backgroundView = nil;

      

+1


source


Declare the table like this to get the usual look of the table.

yourTable = [[UITableView alloc] initWithFrame:CGRectMake(0,0, 320, 460) style:UITableViewStylePlain];

      

0


source


Yes friends, you don't need to do anything, just set the background of the table to zero.

yourTableView.backgroundView = nil;

      

Enjoy :)

0


source







All Articles