コード例 #1
0
    public void Layout(System.Action action)
    {
        if (action != null)
        {
            action();
        }
        _ui();
        var maxHeight = (float)(51.5 / 667.0) * Display.main.systemHeight;

        if (ContentText.text != null && ContentText.text != string.Empty && ContentText.preferredHeight > maxHeight)
        {
            Destroy(ContentText.GetComponent <UnityEngine.UI.ContentSizeFitter>());
            ContentText.rectTransform.sizeDelta = new Vector2(ContentText.rectTransform.sizeDelta.x, maxHeight);
        }
    }