SkillAgentSearch skills...

UniSoftwareKeyboardArea

【Unity】Android でもソフトウェアキーボードの表示領域を取得できるパッケージ

Install / Use

/learn @baba-s/UniSoftwareKeyboardArea
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Uni Software Keyboard Area

Android でもソフトウェアキーボードの表示領域を取得できるパッケージ

使用例

using UniSoftwareKeyboardArea;
using UnityEngine;
using UnityEngine.UI;

public class Test : MonoBehaviour
{
    public CanvasScaler m_canvasScaler;
    public RectTransform m_rectTransform;

    private void Update()
    {
        var rate = m_canvasScaler.referenceResolution.y / Screen.height;
        var pos = m_rectTransform.anchoredPosition;
        pos.y = SoftwareKeyboardArea.GetHeight( true ) * rate;
        m_rectTransform.anchoredPosition = pos;
    }

    private void OnGUI()
    {
        GUILayout.Label( SoftwareKeyboardArea.GetHeight( true ).ToString() );
    }
}

Image (18)

謝辞

  • このリポジトリは下記のサイト様を参考にさせていただいております
    • https://forum.unity.com/threads/keyboard-height.291038/
View on GitHub
GitHub Stars42
CategoryDevelopment
Updated7mo ago
Forks8

Languages

C#

Security Score

82/100

Audited on Aug 16, 2025

No findings