uitableview - Xamarin ios - How to access a cell from a static TableView -
i have issue how tableview rendered on ipad device. despite setting background color clear on story board,the tableview, when testing on ipad has gray background color. have searched around site , found plenty of solutions:
already tried suggestion
public override void viewdidload() { base.viewdidload(); tableview.backgroundview = new uiview(); tableview.backgroundview.backgroundcolor = uicolor.clear; }
and tried override getcell function inside tableview class, can change contentview color accessing cell,
cell.contentview.backgroundcolor but getcell function never called.
edit
here's sample screen 1 of screens has static table view
could point me in right direction?
if want change background color overriding getcell want give custom cells identifier in storyboard , override getcell in tableviews tablesource below. might want check tableview source being set customtablesource in viewdidload:
tableview.source = new customtablesource(this); unless using iuitableviewdatasource check weak delegate , source being set:
tableview.weakdelegate = this; tableview.weakdatasource = this; overriding getcell:
public override uitableviewcell getcell(uitableview tableview, nsindexpath indexpath) { var cell = tableview.dequeuereusablecell("cellidentifier") customcell; if (cell == null) cell = new customcell(); cell.backgroundcolor = uicolor.clear return cell; } you'll have override rowsinsection well:
public nint rowsinsection(uitableview tableview, nint section) { return 7; } 
Comments
Post a Comment