# UIGridLayout

UIGridLayout : `UIGridStyleLayout`

## Overview

형제 UI 요소들을 부모 UI 영역 안에서 여러 줄(Row)로 자동 배치하는 레이아웃입니다. 부모의 가용 공간을 기준으로 요소가 한 줄에 더 이상 들어가지 않으면 자동으로 다음 줄로 넘어가 배치를 이어가는 방식으로 동작합니다.

UIGridLayout은 **클라이언트 환경**에서만 제어할 수 있습니다.

## Properties

### CellPadding

`UDim2`

그리드 형태로 배치된 UI 요소들 사이에 놓일 여유 공간의 크기를 UDim2로 지정합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local Frame = ScreenGui:WaitForChild("Frame")
local UIGridLayout = Frame:WaitForChild("UIGridLayout")

UIGridLayout.CellPadding = UDim2.new(0, 10, 0, 10)
```

### CellSize

`UDim2`

그리드 형태로 배치되는 모든 UI 요소가 어떤 크기를 가질지를 UDim2로 지정합니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local Frame = ScreenGui:WaitForChild("Frame")
local UIGridLayout = Frame:WaitForChild("UIGridLayout")

UIGridLayout.CellSize = UDim2.new(0, 150, 0, 100)
```

### FillDirectionMaxCells

`number`

그리드가 한 줄에 얼마나 많은 셀을 채운 뒤 줄바꿈을 할지 결정합니다.

FillDirection에 따라 “한 행당 허용할 셀 수” 또는 “한 열당 허용할 셀 수”로 동작하며, 값이 클수록 여러 요소를 한 줄에 많이 배치할 수 있습니다.

기본값은 0으로,부모 컨테이너 공간이 허용하는 만큼 계속 채우며 줄바꿈 제한이 없습니다.

#### Code Samples

```lua
local ScreenGui = script.Parent
local Frame = ScreenGui:WaitForChild("Frame")
local UIGridLayout = Frame:WaitForChild("UIGridLayout")

UIGridLayout.FillDirectionMaxCells = 2
```

## Methods

## Events

## See also

{% content-ref url="/pages/K1g0tEWDJhh6a6E4UURk" %}
[GUI](/korean/manual/studio-manual/gui.md)
{% endcontent-ref %}


---

# Agent Instructions: 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://docs.overdare.com/korean/development/api-reference/classes/uigridlayout.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.
