Hi All,
In my Xamarin Forms Android application I needs to get ActionBar Height , I have tried by using Resource ID, I got ActionBar Height, But In my case if ActionBar is not used in my app also I am getting same ActionBarHeight value since ActionBar height value is taken from Resource id. So now my requirement is I need to get ActionBarHeight only Action bar is in View
TypedValue tv = new TypedValue();
var actionBarHeight = 0;
if (XamarinExtensions.Context.Theme.ResolveAttribute(Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize, tv, true))
{
actionBarHeight = TypedValue.ComplexToDimensionPixelSize(tv.Data, Resources.DisplayMetrics);
}
Can anyone help me to getting ActionBar Height only ActionBar is in View?
Also I have used IsShowing bool property of ActionBar to know the visible state of ActionBar , In this case in my NativeView class I tried to access the ActionBar by follwing code,
var actionBar = ((Activity)Context).ActionBar;
if (actionBar.IsShowing),
In this case actionBar is getting as Null Value.
Is there any approach was there to get the ActionBar or ActionBarHeight only when ActionBar comes to the view?