mam pracę wokół, aby rozwiązać ten problem. Jeśli nie chcesz zmieniać koloru tła widoku tabeli, a nadal chcesz usunąć to miejsce.
Zasadniczo utworzyć UIView *view
tył UIRefreshControl
i ustaw kolor tła widoku na kolor, który chcesz w viewDidLoad
metody
-(void)viewDidLoad
{
//you implementation of viewDidLoad
self.view = [[UIView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,0)];
self.view.backgroundColor = [UIColor yourBackgroundColor];
[self.tableView insertSubview:self.view belowSubview:self.refreshControl];
}
Następnie wdrożyć metodę UIScrollViewDelegate
dynamicznie zmienić wysokość widoku tyłu UIRefreshControl
, aby ukryć lukę.
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat offset = scrollView.contentOffset.y;
[self.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, offset + 20)]; // or any small number
}
Uwaga można jeszcze zobaczyć linię bo to separator z tableview można zmienić tableView
„s separator kolor lub styl, aby go usunąć.
Oto przykład projekt https://encodable.com/uploaddemo/files/tableWithReferesh.zip –
mam ten sam problem ... – Jacob
Jak skończyć rozwiązywania tego? – SAHM