2016-06-16 5 views
3

私はXamarin FormsでAndroidアプリを開発しています。ページファイルはXAMLで作成されます。しかし、タイトルフォントのプロパティの変更は利用できません。私のコードは:XamarinフォームでPageTiltle FontFamilyとSizeを設定する方法

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" 
     xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
     x:Class="MasterDetailPageNavigation.ContactsPage" 
     Title="Home" 
     BackgroundColor="#ff6600"> 
     <ContentPage.Content> 
      <StackLayout Padding="110,190,100,80"> 
      <Button BackgroundColor="Transparent" TextColor="White" Image="Button.png"/> 
    <StackLayout Padding="25"> 
    <Label Text="Button" TextColor="#ffffff" FontSize="Small"></Label> 
    </StackLayout> 
</StackLayout> 
</ContentPage.Content> 

変更方法タイトルFontstyle?

+0

LoadApplication(new App());はあなたがアクションバー/ツールバータイトルについて話している行の下に、あなたのMainActivity.csでこれを試してみてくださいことはできますか? – jzeferino

+0

[参照ページ](https://developer.android.com/training/appbar/index.html?hl=ja)これらのリンクは**スプレッドシート**です。 –

+0

http://stackoverflow.com/questions/12897071 /タイトル変更の方法 - テキスト - オン - アクションバー –

答えて

1

あなたは

var spannableString = new SpannableString(SupportActionBar.Title); 
spannableString.SetSpan(new TypefaceSpan("yourfont.otf"), 0, spannableString.Length(), SpanTypes.ExclusiveExclusive); 
SupportActionBar.TitleFormatted = spannableString; 
+0

どのヘッダーファイルが追加されますか? #error –

+0

using Android.Text; Android.Text.Styleを使用しています。 – jzeferino

+0

私の答えが正しいとマークしてくれたらどうか。その良いstackoverflowの練習。私は感謝します。 – jzeferino

関連する問題