> 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/view/modifier/layout.md).

# layout modifier

[SwiftUI](/ios/swiftui.md) ⟩ [view](/ios/swiftui/view.md) ⟩ [modifier](/ios/swiftui/view/modifier.md) ⟩ layout modifier

{% hint style="success" %}
Tell a view how to arrange itself within a [view hierarchy](/ios/swiftui/view/hierarchy.md) by adjusting its <mark style="color:yellow;">size</mark>, <mark style="color:yellow;">position</mark>, <mark style="color:yellow;">alignment</mark>, <mark style="color:yellow;">padding</mark>, and so on.
{% endhint %}

:point\_right: see [view layout](/ios/swiftui/view/layout.md), [Layout](/ios/swiftui/container/layout/layout.md), [layout](/ios/swiftui/container/layout.md) (🚧 under construction)

{% tabs %}
{% tab title="💾 程式" %}

```swift
Ellipse()
    .frame(width: 200, height: 100)    // width, height: CGFloat
```

{% endtab %}

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

* [SwiftUI](https://developer.apple.com/documentation/swiftui) ⟩  [View fundamentals](https://developer.apple.com/documentation/swiftui/view-fundamentals) ⟩ [View](https://developer.apple.com/documentation/swiftui/view) ⟩  [Layout modifiers](https://developer.apple.com/documentation/swiftui/view-layout)
  * [.frame(width:height:alignment:)](https://developer.apple.com/documentation/swiftui/view/frame\(width:height:alignment:\))
  * [.fixedSize()](https://developer.apple.com/documentation/swiftui/view/fixedsize\(\))
    {% endtab %}

{% tab title="📗 參考" %}

* [ ] Sarun ⟩ [What is the fixedSize modifier in SwiftUI](https://sarunw.com/posts/swiftui-fixedsize/)
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lochiwei.gitbook.io/ios/swiftui/view/modifier/layout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
