透過集合功能整理內容
你可以依據偏好儲存及分類內容。
封鎖 >欄位 >repositionForWindowResize
Field.repositionForWindowResize() 方法
開發人員掛鉤,在調整視窗大小時調整 WidgetDiv 的位置。如果欄位含有 WidgetDiv,且必須在調整視窗大小時重新調整位置,您就必須定義這個掛鉤。例如,文字輸入欄位會定義此掛鉤,讓輸入的 WidgetDiv 可以在視窗大小調整事件上重新定位。當強制回應輸入功能遭到停用時,這一點尤其重要,因為 Android 裝置會在螢幕鍵盤開啟時觸發視窗大小調整事件。
如果您想讓 WidgetDiv 隱藏自己,而不是重新調整位置,則傳回 false。此為預設行為。
DropdownDivs 已處理自己的定位邏輯,因此如果欄位只有 DropdownDiv,就不必覆寫這個函式。
Signature:
repositionForWindowResize(): boolean;
傳回:
布林值
如果欄位應重新位置,則為 True;如果 WidgetDiv 應該隱藏自身,則為 false。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[],["The `repositionForWindowResize()` method is a developer hook for repositioning a field's WidgetDiv when the window resizes. It's necessary if a field uses a WidgetDiv that needs adjustment upon window resizing, particularly when modal inputs are disabled. Returning `true` prompts repositioning; `false` hides the WidgetDiv (default). Fields with only DropdownDivs don't require overriding this method, as they manage their own positioning. Text input fields use this hook.\n"]]