Today, we released version 04.05 of our Action Component suite for C# development in Xamarin and Visual Studio. This version includes several requested new features to our Action Tray component.
ACTray
The ability was added to dynamically change the size and/or location of an Action Tray after it has been created and attached to a screen. Use the TraySize
property to adjust the size of the tray and the TrayLocation
property to set its location (relative to the orientation
property). The TraySizeChanges
and TrayLocationChanged
events will be raised when the size or location changes.
The new ContentArea
property provides the “safe” area to present your content inside of the tray (avoiding both the Thumb and Tab areas). The TabArea
property contains the location and size of the Tab inside of the tray’s bounds.
ACTrayManager
The Tray Manage has been enhanced with the ability to dynamically place the trays inside of the apps UI based on the Tab sizes and locations. Use the TabSpacer
property to set the space between automatically laid out Tray Tabs. The TrayOrientation
property will set the orientation of all Trays in the Tray Manager and prepare them for auto layout. Setting the TabLocation
property to anything other than Custom
will enable auto layout of the Trays.
For example in iOS:
using ActionComponents; ... public ACTrayManager TrayManager { get; set; } = new ACTrayManager(); ... // Setup the tray
TrayOne.trayType = ACTrayType.Popup;
TrayOne.TraySizeChanged += (t, s) =>
{
ScrollView.Frame = TrayOne.ContentArea;
};
TrayOne.TraySize = new CGSize(400, 300);
TrayManager.AddTray(TrayOne);
TrayTwo.trayType = ACTrayType.Popup;
TrayManager.AddTray(TrayTwo);
TrayThree.trayType = ACTrayType.Popup;
TrayManager.AddTray(TrayThree);
// Set the tray manager to auto layout the trays
TrayManager.TrayOrientation = ACTrayOrientation.Bottom;
TrayManager.TabLocation = ACTrayTabLocation.BottomOrRight;
In the example above, three trays were added to the Main.storyboard
file and exposed to C# code. The trays are then added to a Tray Manager and automatically laid out using the TrayOrientation
and TabLocation
properties.