> For the complete documentation index, see [llms.txt](https://lochiwei.gitbook.io/ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lochiwei.gitbook.io/ios/swiftui/control/image.md).

# Image

[SwiftUI](/ios/swiftui.md) ⟩ [control](/ios/swiftui/control.md) ⟩ Image

{% hint style="success" %}
:star: 基本語法：

```swift
// Some code
Image("name")
```

{% endhint %}

{% tabs %}
{% tab title="🔸 屬性" %}

* [.resizable()](https://developer.apple.com/documentation/swiftui/image/resizable\(capinsets:resizingmode:\))
  {% endtab %}

{% tab title="🔴 主題" %}

* [image.renderingMode()](/ios/swiftui/control/image/image.renderingmode.md)
* [SF Symbols](/ios/swiftui/control/image/sf-symbols.md)
* [Image(playground:)](/ios/custom/ext/image/image-playground.md)
*

{% endtab %}

{% tab title="💈範例" %}

```swift
Image("Landscape_4")    // image from asset or bundle
    // ⭐️ scale it to fit within its container
    .resizable()        
    .aspectRatio(contentMode: .fit)    // = .scaledToFit()
    .frame(width: 80.0, height: 80.0)
```

{% endtab %}

{% tab title="📘 手冊" %}

* [SwiftUI](https://developer.apple.com/documentation/swiftui) ⟩ [Images](https://developer.apple.com/documentation/swiftui/images) ⟩ [Image](https://developer.apple.com/documentation/swiftui/image)
* SwiftOnTap ⟩ View ⟩&#x20;
  * [.resizable(capInsets:resizingMode:)](https://swiftontap.com/image/resizable\(capinsets:resizingmode:\))
  * [.scaledToFit()](https://swiftontap.com/view/scaledtofit\(\))
    {% endtab %}

{% tab title="📜 協定" %}

* `Swift.Equatable`
* [`View`](https://developer.apple.com/documentation/swiftui/view)
  {% endtab %}
  {% endtabs %}
