0
我遇到麻煩試圖創建使用Xamarin.iOS iOS版忍者圓環圖。ShinobiCharts拋出CALayerInvalidGeometry錯誤
,我使用設置圖表的代碼如下:
private void SetupSChart(){
float margin = 0;
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
margin = 10;
} else {
margin = 50;
}
var frame = UIScreen.MainScreen.Bounds;//new RectangleF (margin, margin, View.Bounds.Width - 2 * margin, View.Bounds.Height - 2 * margin);
m_schart = new ShinobiChart (frame){
Title = "Poll replies/answer",
AutoresizingMask = UIViewAutoresizing.None
};
View.AddSubview (m_schart);
m_schart.DataSource = new ChartDataSource(this.Poll);
m_schart.Legend.Hidden = false;
}
然後,我得到以下異常:
CALayerInvalidGeometry
Objective-C exception thrown. Name: CALayerInvalidGeometry Reason: CALayer position contains NaN: [nan nan]
CALayer position contains NaN: [nan nan]
我在做什麼錯?
感謝
是的!謝謝丹。對於這個問題,我打算回覆你的帖子。等待在支撐通道中的其他問題的答覆。謝謝! –