BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
Is it possible to set the Android StatusBar BackgroundColor in Gradient, when using shell, with the GradientView?
Thank you,
Helder Correia
Hi Helder Correia,
Your requirement can be achieved by adding a custom render to the app shell as mentioned in the below code snippet
[C#]
[assembly: ExportRenderer(typeof(AppShell), typeof(CustomShellRenderer))] namespace GradientShell.Droid { public class CustomShellRenderer : ShellRenderer { public CustomShellRenderer(Context context) : base(context) { }
protected override IShellToolbarAppearanceTracker CreateToolbarAppearanceTracker() { return new CustomToolbarAppearanceTracker(); } }
// Toolbar appearance public class CustomToolbarAppearanceTracker : IShellToolbarAppearanceTracker { public void Dispose() {
}
public void ResetAppearance(AndroidX.AppCompat.Widget.Toolbar toolbar, IShellToolbarTracker toolbarTracker) { }
public void SetAppearance(AndroidX.AppCompat.Widget.Toolbar toolbar, IShellToolbarTracker toolbarTracker, ShellAppearance appearance) { toolbar.SetBackgroundResource(Resource.Drawable.custom_gradient); } } } |
[XAML]
<?xml version="1.0" encoding="utf-8" ?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<gradient android:type="linear" android:startColor="#2d265b" android:endColor="#b8495c" android:angle="270"/> </shape> |
We have prepared a sample to achieve your requirement and please get it from below attachment. For more details, please refer the below link.
Regards,
Eswaran
Thank you, its perfect.
Hi Helder,
Thank you for the update.
We are glad that the provided response meets your requirements. Please let us know if you need further assistance. As always, we are happy to help you out.
Regards,
Preethi R