设置CTStringAttributes字体后无法访问string大小

我正在尝试使用string和特定字体呈现一个CATextLayer。 如果使用CATextLayer设置字体,字体不会正确呈现。 如果我在CTStringAttributes中设置字体,那么我得到以下错误:

Unhandled Exception: MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[__NSCFType screenFontWithRenderingMode:]: unrecognized selector sent to instance 0x13dba570 

这是我想要使用的代码:

 CTStringAttributes ctsa = new CTStringAttributes(); //This method returns what out kerning should be loosely based on the //tracking number our UI designer uses in Adobe Illustrator var trackingSize = MyFonts.IllustratorTracking(200f * 0.8f, MyFonts.CardHeader.PointSize); ctsa.KerningAdjustment = trackingSize; ctsa.ForegroundColor = MyColors.CardHeaderText.CGColor; ctsa.Font = MyFonts.CardHeaderCT; NSAttributedString someString = new NSAttributedString(title, ctsa); titleLayer = new CATextLayer(); titleLayer.Frame = new RectangleF(19, ((20 - someString.Size.Height) / 2.0f), someString.Size.Width, someString.Size.Height); titleLayer.ForegroundColor = MyColors.CardHeaderText.CGColor; titleLayer.BackgroundColor = UIColor.Clear.CGColor; titleLayer.AttributedString = someString; headerView.Layer.AddSublayer(titleLayer);