Ejemplo n.º 1
0
        public override UIView GetView(SunburstSegment segment)
        {
            UIView customView = new UIView();

            customView.BackgroundColor = UIColor.Black;

            UILabel label = new UILabel();

            label.TextColor = UIColor.White;
            label.Font      = UIFont.FromName("Helvetica", 13f);
            label.Text      = "Category : " + segment.Category;
            var labelSize = label.SystemLayoutSizeFittingSize(UIKit.UIView.UILayoutFittingExpandedSize);

            label.Frame = new CGRect(7, 7, labelSize.Width, labelSize.Height);

            UILabel label1 = new UILabel();

            label1.TextColor = UIColor.White;
            label1.Font      = UIFont.FromName("Helvetica", 13f);
            label1.Text      = "Value : " + segment.Value;
            var labelSize1 = label1.SystemLayoutSizeFittingSize(UIKit.UIView.UILayoutFittingExpandedSize);

            label1.Frame = new CGRect(7, labelSize.Height + 7, labelSize1.Width, labelSize1.Height);

            customView.AddSubview(label);
            customView.AddSubview(label1);

            var height = label.Frame.Height + label1.Frame.Height;
            var width  = label.Frame.Width > label1.Frame.Width ? label.Frame.Width : label1.Frame.Width;

            customView.Frame = new CGRect(0, 0, width + 14, height + 14);

            return(customView);
        }
Ejemplo n.º 2
0
        public override View GetView(SunburstSegment segment)
        {
            LinearLayout linearLayout = new LinearLayout(context);

            linearLayout.Orientation = Orientation.Vertical;

            TextView textView = new TextView(context);

            textView.SetTextColor(Color.White);
            textView.Text = "Category : " + segment.Category;

            TextView textView1 = new TextView(context);

            textView1.SetTextColor(Color.White);
            textView1.Text = "Value : " + segment.Value;

            linearLayout.AddView(textView);
            linearLayout.AddView(textView1);

            return(linearLayout);
        }