SfRadialMenuItem Customization

3 Sep 202024 minutes to read

The SfRadialMenuItem class provides various options such as Custom Views, FontIcons, and Images to customize the items. You can add radial menu items by hierarchy. To add a SfRadialMenuItem with SfRadialMenu, create an instance of SfRadialMenuItem, and add it to the Items property that is available in SfRadialMenu.

Items

The Items ) property populates the items of an inner rim in SfRadialMenu when the items of an outer rim are tapped.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut" });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Copy" });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

Text

The Text property provides text to the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut" });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Copy" });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

Height

The Height changes the height of the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", Height = 50 });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", Height = 50 });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

Width

The Width property changes the width of the [https://help.syncfusion.com/cr/xamarin-ios/Syncfusion.SfRadialMenu.iOS~Syncfusion.SfRadialMenu.iOS.SfRadialMenuItem.html).

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", Width = 100 });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", Width = 100});
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with Items

BackgroundColor

The BackgroundColor property changes the background color of the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", BackgroundColor = UIColor.FromRGB(232, 25, 156) });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Copy", BackgroundColor = UIColor.FromRGB(232, 25, 156) });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with BackgroundColor

Font

The Font property changes the font family of text in SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", Font = UIFont.FromName("Times New Roman", 15) });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Copy", Font = UIFont.FromName("Times New Roman", 15) });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

FontSize

The FontSize property changes the text size of the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Cut", IconFont = UIFont.FromName("Times New Roman", 30), FontSize = 15 });
            radialMenu.Items.Add(new SfRadialMenuItem() { Text = "Copy", IconFont = UIFont.FromName("Times New Roman", 30),FontSize = 15 });
            radialMenu.Items[0].Items.Add(new SfRadialMenuItem() { Text = "Paste" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with Font

Image

The Image property provides image support to the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { Image = "HomePageLibrary.png" });
            radialMenu.Items.Add(new SfRadialMenuItem() { Image = "eServices.png" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with Image

BackgroundImage

The BackgroundImage property provides the background image support to the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { BackgroundImage = "HomePageLibrary.png" });
            radialMenu.Items.Add(new SfRadialMenuItem() { BackgroundImage = "eServices.png" });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

FontIcon

The FontIcon property provides font icon support to the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uE9AB", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uEB73", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with FontIcon

FontIconColor

The FontIconColor property changes the color of font icon in SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uE9AB", IconFont = UIFont.FromName("Sample", 20) , FontIconColor = UIColor.FromRGB(232, 25, 156) });
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uEB73", IconFont = UIFont.FromName("Sample", 20), FontIconColor = UIColor.FromRGB(232, 25, 156) });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

SfRadialMenu with FontIconColor

FontSize

The FontSize property changes the size of font icon in the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uE9AB", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uEB73", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}

IconFont

The IconFont property changes the font family of font icon in the SfRadialMenuItem.

using Foundation;
using Syncfusion.SfRadialMenu.iOS;
using System;
using UIKit;

namespace RadialMenuNative
{
    public partial class ViewController : UIViewController
    {
        public ViewController(IntPtr handle) : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            SfRadialMenu radialMenu = new SfRadialMenu();
            radialMenu.CenterButtonIconFont = UIFont.FromName("Sample", 30);
            radialMenu.CenterButtonText = "\uE713";
            radialMenu.RimRadius = 100;
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uE9AB", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.Items.Add(new SfRadialMenuItem() { FontIcon = "\uEB73", IconFont = UIFont.FromName("Sample", 20) });
            radialMenu.CenterButtonPlacement = SfRadialMenuCenterButtonPlacement.Center;
            this.View.AddSubview(radialMenu);
        }

        public override void DidReceiveMemoryWarning()
        {
            base.DidReceiveMemoryWarning();
            // Release any cached data, images, etc that aren't in use.
        }
    }
}