2016-08-09 68 views
1

ich so mehrere Lösung Ich versuche meine UITableView transparentWie machen UITableView transparent

func tableView(tableView: UITableView, cellForRowAtIndexPath  indexPath: NSIndexPath) -> UITableViewCell { 
     tableView.backgroundColor=UIColor.clearColor() 
    let cell = tableView.dequeueReusableCellWithIdentifier("signCell", forIndexPath: indexPath) as! SignUpTableViewCell 


    cell.backgroundColor=UIColor.clearColor() 
    cell.signInfo.text="Mee" 

    return cell 
} 

und ich mache meinen Text durchsichtig auch zu machen, aber die Tabelle und Text danach verschwinden.

+0

se ths einmal http://stackoverflow.com/questions/1008246/how-to-create-a-uitableviewcell- mit-einem-transparent-hintergrund –

+0

tableView.backgroundColor = UIColor.clearColor() –

+0

@ Anbu.Karthik Ich möchte Lösung in swift – Sam

Antwort

2

Versuchen Sie diesen Code in ViewDidLoad

_tableView.backgroundColor = UIColor.clearColor() 
0

In manchen Situationen ist tableView.backgroundColor Einstellung nicht funktionieren und der Hintergrund des Tableview ist immer weiß. Ich kam in diesem Thema, wenn ein UITableView in einem benutzerdefinierten UIView mit und löste es mit diesem:

public func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {   
    tableView.backgroundColor = UIColor.clear 
}