我正在使用Xamarin Forms开发Android Apllication。页面文件在XAML中创建。但Title Font属性更改不可用。我的代码是:
INSERT INTO [ProjectManagement].[dbo].[Groups]
(Name, Description, Priority ,CreatorId, InsertDate, IsDeleted)
SELECT Bezeich, cast(Notiz as ntext), Prio, 1, GETDATE(), 0
FROM [MigrationAPlanDB].[dbo].[Ordner]
INSERT INTO [ProjectManagement].[dbo].[Projects]
(Name, Description, UpdateDate, CreatorId, InsertDate)
SELECT p.Bezeich, p.Notiz, p.LastModification, 1, GETDATE()
FROM [MigrationAPlanDB].[dbo].[Projekte] p
JOIN [MigrationAPlanDB].[dbo].[Ordner] o on p.Ord_Id = o.Ord_Id
如何更改Title Fontstyle?
答案 0 :(得分:1)
您可以在MainActivity.cs
LoadApplication(new App());
中试试这个
var spannableString = new SpannableString(SupportActionBar.Title);
spannableString.SetSpan(new TypefaceSpan("yourfont.ttf"), 0, spannableString.Length(), SpanTypes.ExclusiveExclusive);
SupportActionBar.TitleFormatted = spannableString;
答案 1 :(得分:0)
从此answer开始,然后在ContentPage
中添加:
<NavigationPage.TitleView>
<Label VerticalOptions="Center" MaxLine="1" FontFamily="/*OUR FONT GOES HERE*/" Text="Our new title" />
</NavigationPage.TitleView>
或:
<Shell.TitleView>
<Label VerticalOptions="Center" MaxLine="1" FontFamily="/*OUR FONT GOES HERE*/" Text="Our new title" />
</Shell.TitleView>