thể trùng lặp:
Change background of a grouped UITableViewSet màu nền trên UITableView trong IOS 6
Tôi không thể thay đổi màu nền của UITableView nếu nó là . Mã của tôi:
[addressNewTbl setBackgroundColor:[UIColor redColor]];
Help!
thể trùng lặp:
Change background of a grouped UITableViewSet màu nền trên UITableView trong IOS 6
Tôi không thể thay đổi màu nền của UITableView nếu nó là . Mã của tôi:
[addressNewTbl setBackgroundColor:[UIColor redColor]];
Help!
Bạn có thể cần phải thêm một số mã. Thử -
[UITableView setBackgroundView: nil];
hoặc bạn cũng có thể làm:
UIView* bview = [[UIView alloc] init];
bview.backgroundColor = [UIColor yellowColor];
[tableView setBackgroundView:bview];
Cả hai sẽ làm việc ..
Bạn bổ sung cần phải tắt chế độ xem nền:
[addressNewTbl setBackgroundView:nil];
Bạn có thử
addressNewTbl.backgroundView = nil;
[addressNewTbl setBackgroundColor:[UIColor redColor]];
Thay vì thiết lập màu nền của toàn bộ UITableView
, hãy thử những gì xảy ra khi bạn thiết lập màu nền của backgroundView
.
trong cellForRowAtIndexPath nguồn dữ liệu thiết
[cell setBackgroundColor:[UIcolor redColor]];
OP là về nền của bảng không phải là nền của ô .. – Maulik
Chào mừng bạn đến ngăn xếp method.try. Nếu bạn có câu trả lời thì bạn nên chấp nhận câu trả lời đó ... – Maulik