titleFontWeight

The titleFontWeight property is used to set the font weight of the mini program page title. By adjusting this value, you can control the thickness of the text displayed in the title bar.

Method signature

copy
var titleFontWeight: CGFloat

Parameters

Parameter

Data Type

Required

Description

titleFontWeight

CGFloat

No

Specifies the font weight of the page title.

Note: The value must be greater than or equal to UIFontWeightUltraLight (-0.8). If the value is less than UIFontWeightUltraLight (-0.8), the default value UIFontWeightBold is used.

Valid values:

  • UIFontWeightUltraLight (-0.8)
  • UIFontWeightThin (-0.6)
  • UIFontWeightLight (-0.4)
  • UIFontWeightRegular (0.0)
  • UIFontWeightMedium (0.23)
  • UIFontWeightSemibold (0.3)
  • UIFontWeightBold (0.4)
  • UIFontWeightHeavy (0.56)
  • UIFontWeightBlack (0.62)

Sample

copy
let param = GRVStartupParams()
param.titleFontWeight = 0.9

let viewController = try GRVAppContainerLaunch.sharedInstance().openApp(withUrl: url, startupParams: param)
let navigationController = self.navigationController ?? UIApplication.shared.windows.first?.rootViewController as? UINavigationController
navigationController?.pushViewController(viewController, animated: true)

User experience

For example, the following figure shows the title when setting titleFontWeight = 0.9.

image.png