Ios 如何更改GetCell()中的单元格颜色?
我正在使用Xamarin.SideMenu NuGet包。 一切都很好,除了我需要做一些定制。我主要需要更改弹出式抽屉菜单选项的字体颜色 我已尝试设置cell.TintColor=UIColor.Red;,但它什么也没做 这是我的密码:Ios 如何更改GetCell()中的单元格颜色?,ios,xamarin,colors,xamarin.ios,cell,Ios,Xamarin,Colors,Xamarin.ios,Cell,我正在使用Xamarin.SideMenu NuGet包。 一切都很好,除了我需要做一些定制。我主要需要更改弹出式抽屉菜单选项的字体颜色 我已尝试设置cell.TintColor=UIColor.Red;,但它什么也没做 这是我的密码: public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath) { var cell = table
public override UITableViewCell GetCell(UITableView tableView, Foundation.NSIndexPath indexPath)
{
var cell = tableView.DequeueReusableCell(“VibrantCell”);
cell.TextLabel.Text = “Index ” + indexPath.Row;
cell.TintColor = UIColor.Blue;
cell.BackgroundColor = UIColor.Green;
return cell;
}
[Export(“tableView:willDisplayCell:forRowAtIndexPath:“)]
public override void WillDisplay(UITableView tableView, UITableViewCell cell, Foundation.NSIndexPath indexPath)
{
cell.TintColor = UIColor.Red; // no effect?
cell.BackgroundColor = UIColor.Green; // no effect?
}
由于某种原因,颜色没有改变,仍然是黑色
有没有办法在原生Xamarin.iOS上获得文本颜色不是黑色的弹出式抽屉
非常感谢。您不应该修改单元格本身。您应该修改单元格的TextLabel属性 因此,它应该是:
cell.TextLabel.TextColor = UIColor.Red;
就这样。非常感谢。