【问题标题】:iOS Swift: UIAlertController ignores maximumContentSizeCategoryiOS Swift: UIAlertController ignores maximumContentSizeCategory
【发布时间】:2022-12-02 00:53:13
【问题描述】:

I'm trying to limit the dynamic text sizes of the UIAlertControllers in my app.

I have tried this:

let alertController = UIAlertController(title: "Test", message: nil, preferredStyle: .actionSheet)
alertController.view.maximumContentSizeCategory = UIContentSizeCategory.extraExtraExtraLarge
alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel))
present(alertController, animated: true, completion: nil)

but the maximumContentSizeCategory is ignored. How can I set a maximum dynamic font size for UIAlertController?

【问题讨论】:

    标签: ios swift fonts uikit dynamic-type-feature


    【解决方案1】:

    You can't customize a UIAlertController very much. Since it is just a presented view controller, simply write your own custom presented view controller whose viewlookslike an alert.

    【讨论】:

      猜你喜欢
      • 2017-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多