CrossMedia.Current.PickPhotoAsync change Title & Color

AbhayL 6 Reputation points
2021-03-19T04:24:23.39+00:00

I'm using Changing Title and Title background to pickup a file.

When navigated to show the Albums/Pick files, the default color of Action Bar is Blue. I tried to override the action bar color from my application but no Luck.

In my main application i called it like below -
var file = await CrossMedia.Current.PickPhotoAsync();

In Android application i tried to override the color like below -

public class MainApplication : Application, Application.IActivityLifecycleCallbacks  
{  
    public MainApplication(IntPtr handle, JniHandleOwnership transer)  
      : base(handle, transer)  
    {  
    }  

    public override void OnCreate()  
    {  
        base.OnCreate();  
        RegisterActivityLifecycleCallbacks(this);  
    }  

public void OnActivityCreated(Activity activity, Bundle savedInstanceState)
{
if (activity != null)
{

            activity.Window.ClearFlags(WindowManagerFlags.TranslucentStatus);  
           activity.Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);  
          activity.Window.SetStatusBarColor(Android.Graphics.Color.LightPink);  
            activity.Window.SetTitleColor(Android.Graphics.Color.LightPink);  
        }  
        CrossCurrentActivity.Current.Activity = activity;  
}  

}

The title bar color works fine inside my application... i want to make the color same when i click the browse button and it opens the UI to choose file.79476-color.jpg

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
{count} votes