xamarin - 如何更改导航页面中后退箭头和后退文本的字体大小和粗细?

标签 xamarin xamarin.forms xamarin.ios

我对如何更改标题字体有类似的问题,如下:

How can I change the Font Size and Weight for the Header in a Navigation Page?

现在我已经改变了,有人知道如何更改顶部后退箭头的字体大小和粗细以及导航页面顶部的消息吗?似乎这些不是标题的一部分,因为它们保留了原始的字体大小和粗细。

最佳答案

我认为这个问题只发生在iOS平台上,所以解决方案是

AppDelegateFinishedLaunching中设置UIBarButtonItem外观

UITextAttributes att = new UITextAttributes();
att.Font = UIFont.SystemFontOfSize(20.0 , FontAttributes.Bold); // size and weight

UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof( UINavigationBar) }).SetTitleTextAttributes(att, UIControlState.Normal);
UIBarButtonItem.AppearanceWhenContainedIn(new Type[] { typeof(UINavigationBar) }).SetTitleTextAttributes(att,  UIControlState.Highlighted);

关于xamarin - 如何更改导航页面中后退箭头和后退文本的字体大小和粗细?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48535792/

相关文章:

android - Android 上的 Xamarin WebView 显示多个实例

c# - 如何读取 Xamarin Forms PCL 项目中的文本文件?

c# - 使用 Xamarin.Forms(xaml 和 c#)创建超链接

ios - 对象引用未设置到对象的实例 - Select 语句 Sqlite Xamarin iOS

android - MvvmCross,未调用特定于平台的值转换器

c# - 在 C# 中将 DataUrl 转换为图像并写入包含字节的文件

c# - Android.Content.Res.Resources+NotFoundException Drawable com.companyname.mySchool :drawable/splash_screen with resource ID #0x7f02012c

android - 如何隐藏android微调器下拉列表中的第一项?

c# - 访问模拟设备的 Android.Specialfolder.Personal 文件夹中的文件

xamarin.ios - 为什么我必须保留对 UIViewController 的引用以防止它被垃圾收集?