Change the title font on a MobileScreen (iOS)

Hi,

does somebody know a way to change the title font on a MobileScreen?

I already had a look at the iOSDesignExtensions but there is no extension for it.

Thanks a lot.

I turn off the Navigation Bar and use a label for the title.

I haven’t looked into this yet as it is quite complicated to do in Xojo and there are many declares involved.

It would also be nice to be able to use SF Symbols icons for Toolbar buttons!

1 Like

That is possible already using Picture.SystemImage(“SF Symbol Name”, Size)

For example:

Var MainMenuButton As New MobileToolbarButton(MobileToolbarButton.Types.Custom, "", Picture.SystemImage("line.3.horizontal", 16))
MainMenuButton.Tag = "mainmenu"
Screen.LeftNavigationToolbar.AddButton(MainMenuButton)

2 Likes

When using SF Symbols in MobileToolbarButtons I recommend using size 0.
Like this:

Var MainMenuButton As New MobileToolbarButton(MobileToolbarButton.Types.Custom, "", _
  Picture.SystemImage("line.3.horizontal", 0)) //Use size 0 here
MainMenuButton.Tag = "mainmenu"
Screen.LeftNavigationToolbar.AddButton(MainMenuButton)

Also note that SF Symbol images are available starting from iOS13.
If you do not specify a fallback image, it is better to set the minimum version to 13.0 in the iOS build settings:

In the past year, 0.05% of my users are still on iOS 11 or iOS 12.
I will be dropping iOS11 and iOS12 support very soon for all my apps.

Screenshot 2024-09-01 at 19.21.53

1 Like

Thanks. I’m 72, so I forgot. :wink:

Although most symbols are available in iOS13, each year they add new ones that I believe require the iOS version from that year to use. Luckily, the inspector for a symbol in SF Symbols tells you the minimum.

You are correct.

That’s why my code is full of Nil checking for pictures:

Dim pic As Picture = Picture.SystemImage("checkmark.circle.badge.xmark", 0, Picture.SystemImageWeights.Semibold, &cFFFFFF)
if pic is nil then
  //Fallback for iOS13
  pic = Picture.SystemImage("circle", 0, Picture.SystemImageWeights.Regular, &cFFFFFF)
end if

if pic is nil then Return nil //Fallback for iOS12
1 Like