What is the “Mode” property in Interface Builder which offers “Scale to fill”, “Aspect fit” etc.?

前端 未结 3 815
再見小時候
再見小時候 2020-12-23 20:11

I\'m wondering what the dropdown \"Mode\" is about? It contains \"Scale to fill\", \"Aspect fit\" and so on. I never had to change it so far, still I\'m curious what it can

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-23 20:42

    View Programming Guide goes into details of what you're asking about. If you scroll down to the section called "Content Modes" you'd find what you're looking for.

    Basically according to Apple:

    "Each view has a content mode that controls how the view recycles its content in response to changes in the view’s geometry [...] the value in the contentMode property determines whether the bitmap should be scaled to fit the new bounds or simply pinned to one corner or edge of the view."

提交回复
热议问题