Light gray background in “bounce area” of a UITableView

前端 未结 16 2109
一整个雨季
一整个雨季 2020-11-28 23:05

Apple\'s iPhone apps such as Music and Contants use a search bar in a UITableView. When you scroll down so that the search bar moves down, the empty space above the scroll v

16条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 23:18

    To extend on HusseinB's suggestion:

    Swift 3

    let bgView = UIView()
    bgView.backgroundColor = UIColor.white
    self.tableView.backgroundView = bgView
    

    Objective C

    UIView *bgView = [UIView new];
    bgView.backgroundColor = [UIColor whiteColor];
    [self.tableView setBackgroundView:bgView];
    

提交回复
热议问题