i have uitableview
inside uitableviewcell
(scrolling disabled nested uitableview
)
everything works fine. there issue when tap on cell. gets highlighted, nested uitableview
changes color white not good.
is there way change this? set nested uitableview's
backgroundview
, cells
transparent
.
edit: selection
disabled nested uitableview
. tap occurs on cell of outer uitableview
, makes whole inner uitableview
turn white.
edit2: here screenshots before , during tap
edit3: code of first uitableview
:
in viewcontroler's
viewdidload
self.tableview.delegate = self self.tableview.datasource = self self.tableview.backgroundcolor = uicolor.darkbluecolor() self.tableview.registernib(uinib(nibname: "timelineday", bundle: nil), forcellreuseidentifier: timelinedaytableviewcell.identifier)
in timelinedaytableviewcell's
awakefromnib
()
self.tableview.delegate = self self.tableview.datasource = self self.tableview.backgroundcolor = uicolor.darkbluecolor() self.tableview.backgroundview = uiview.clearview() self.selectedbackgroundview = uiview.viewwithbackgroundcolor(uicolor.accentcolor()) self.tableview.registernib(uinib(nibname: "eventitemcell", bundle: nil), forcellreuseidentifier: eventitemtableviewcell.identifier)
in eventitemtableviewcell's
awakefromnib
()
self.backgroundview = uiview.clearview() self.selectedbackgroundview = uiview.clearview()
you may need subclass cell:
class yourtableviewcellclass: uitableviewcell { @iboutlet weak var yourlabel: uilabel! override func setselected(_ selected: bool, animated: bool) { if(selected) { self.contentview.backgroundcolor = uicolor.red //or want self.yourlabel.textcolor = uicolor.green //or want } else { self.contentview.backgroundcolor = uicolor.white //or want self.yourlabel.textcolor = uicolor.green //or want } } }
Comments
Post a Comment