Black Background When Scroll Up Table View
Asked Answered
R

4

6

In my project I used a navigation controller embedding a table view controller. But when I scroll up the table view a black background shows up (as shown in the .gif below)

how can I fix this? Thanks.

enter image description here

Rambert answered 20/8, 2015 at 14:31 Comment(5)
What is the backgroundColor property of your viewController ?Shelba
@Poql it seems that view controllers have no color property, but the background color of all views have been set as whiteRambert
Sure. Even the backgroundColor of your tableView ?Shelba
@Poql yeah, I just checked thatRambert
Also check your code. It looks like your bar is a bit black with the transparency it must be the controller's view or something behind your tavleView. You can use view debugging (available since Xcode 6) to see what's going on.Shelba
R
2

I just found the solution myself. In case someone else has the same problem, here's what to do:

  • Select your table view

  • Go to Attribute Inspector

  • Find the Scroll View section and change the Style property to white

enter image description here

Rambert answered 20/8, 2015 at 15:28 Comment(1)
not work for me i have one view in that view i took scroll view and inside scroll view i took another view and in that view i took all other tools.... got me ?Karissakarita
B
0

set the properties of scrollview background color as white

Background answered 25/6, 2016 at 9:35 Comment(0)
S
0

I had the same problem and I added following codes:

yourTableView.layer.backgroundColor = UIColor.white.cgColor

I hope it helps.

Shirr answered 30/1, 2020 at 13:0 Comment(0)
T
0

Set background color to table view in viewDidLoad

override func viewDidLoad() {
    super.viewDidLoad()
    tableview.backgroundColor = .white
}
Thumbtack answered 30/1, 2024 at 12:59 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.