かずきのBlog@hatena

すきな言語は C# + XAML の組み合わせ。Azure Functions も好き。最近は Go 言語勉強中。日本マイクロソフトで働いていますが、ここに書いていることは個人的なメモなので会社の公式見解ではありません。

Xamarin.FormsのNavigationPageのアイコンの変え方が知りたい

続き書きました

Xamarin.FormsのNavigationPageのアイコンの変え方(Android) - かずきのBlog@hatena

本文

デフォルトのXamarinのアイコンじゃなくて独自アイコンにしようと思ってNavigationPage内のページにNavigationPage.TitleIcon添付プロパティをセットしたんです。

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage 
  xmlns="http://xamarin.com/schemas/2014/forms"
  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:viewModels="clr-namespace:App10.ViewModels;assembly=App10"
  x:Class="App10.Views.MainPage"
  NavigationPage.TitleIcon="bird.png">
  <StackLayout>
    <Label Text="okokokokook" />
  </StackLayout>
</ContentPage>

Androidで実行するとアイコンが左じゃなくて真ん中の変な位置に…。

f:id:okazuki:20150211135432p:plain

左にこないのはバグなのか、やりかたが間違ってるのか悩む…。