Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何更改GetCell()中的单元格颜色?_Ios_Xamarin_Colors_Xamarin.ios_Cell - Fatal编程技术网

Ios 如何更改GetCell()中的单元格颜色?

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

我正在使用Xamarin.SideMenu NuGet包。

一切都很好,除了我需要做一些定制。我主要需要更改弹出式抽屉菜单选项的字体颜色

我已尝试设置cell.TintColor=UIColor.Red;,但它什么也没做

这是我的密码:

   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;

就这样。非常感谢。