小编RPl*_*lay的帖子

5
推荐指数
3
解决办法
343
查看次数

GMSMapView clear 不清除内存

我的应用中有一个 GMSMapView。带有开放地图屏幕的应用程序占用 150 mb 内存。

在某些时候,我添加了很多多边形。之后,应用程序需要 230 mb。

调用 [GMSMapView clear] 方法后,所有多边形都消失了,但应用程序仍占用 230 mb 的内存。

指向多边形的指针不会存储在其他任何地方。如何使地图清除内存以及为什么在调用“清除”方法后不会发生这种情况?

google-maps objective-c ios google-maps-sdk-ios gmsmapview

2
推荐指数
1
解决办法
1408
查看次数

iOS 14 中的可变字体

以下代码允许创建具有不同权重的字体。

func makeFont(weight: CGFloat, size: CGFloat) -> UIFont {
    var attributesDict = [String: Any]()
    attributesDict["Weight"] = weight
    /* Rubik-Light - is a variable font */
    let fontDescriptor = UIFontDescriptor(
        fontAttributes: [
            UIFontDescriptor.AttributeName.name : "Rubik-Light",
            kCTFontVariationAttribute as UIFontDescriptor.AttributeName : attributesDict
        ]
    )
    return UIFont(descriptor: fontDescriptor, size: size)
}
Run Code Online (Sandbox Code Playgroud)

它在 ios 13 及更低版本上运行良好,但在 iOS 14 上不起作用。有什么解决方案吗?

ios swift uifontdescriptor ios14 variable-fonts

0
推荐指数
1
解决办法
326
查看次数