Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 76418

How do I Set the Icon for the MasterDetailPage Master Icon using a drawable?

$
0
0

How do I SetIcon for the MasterDetailPage Master Icon? The following code will only update the actionBar Icon Drawable.

The MasterDetailPage.Master.Icon attribute only accepts a FileImageSource and I'm creating a drawable from a Font (*.tff file).

 public class MyMasterDetailRenderer : MasterDetailRenderer
    {
        protected override void OnAttachedToWindow()
        {
            base.OnAttachedToWindow();            
            var actionBar = ((Activity)this.Context)?.ActionBar;
            if (actionBar != null)
            {

                var fontDrawable = new FontDrawable(this.Context, StyleKit.SpinIcon, Color.White.ToAndroid(), 32);               
                actionBar.SetIcon(fontDrawable);
            }
        }
    }

Viewing all articles
Browse latest Browse all 76418

Trending Articles


Tabia za mabinti wa kipogoro,


Grimsby rapist jailed after attacking same woman twice on same day


HOt And Séxy Photos of Mampi


Neem Baba Extra Questions Answer Class 6 English Poorvi


Lloyds Auctioneers & Valuers Pty Limited v Benson [2025] FCA 324


Download: Chester – Baleken Basabaile (Prod. By Silva)


DT 31015


Turing Cup 2019 Qualifiers (TCQF19) - EDITORIAL


Bingie


Problem with "Removable Bootloader"



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>