public static GUILayoutOption Height (float height);

Description

传递给控件以使其具有绝对高度的选项。

注意:该选项将覆盖自动高度布局参数


Fixed Height for a GUI Control.

using UnityEngine;

public class ExampleScript : MonoBehaviour { // Draws a button with a fixed height void OnGUI() { GUILayout.Button("A Button with fixed height", GUILayout.Height(300)); } }