我使用 Ionic v5 創建了一個簡單的“注冊”頁面,并且對 CSS 和樣式一般來說非常陌生。我無法找到一種方法來阻止鍵盤向上移動我的內容(見圖)

我的 CSS:
.bottom-grid {
position: absolute;
left: 0;
right: 0;
width: 85%;
bottom: 10px;
}
.form-grid {
position: absolute;
left: 0;
right: 0;
width: 85%;
}
通過在這里搜索一些帖子,我嘗試將位置更改為固定,并添加:
ion-grid {
min-height: 100%;
}
沒有太多的運氣。如何將此底部網格保留在頁面底部?感謝您的任何幫助!
uj5u.com熱心網友回復:
我的建議是使用 ion-footer。
<ion-header>
<ion-back-button>
Register
...
</ion-header>
<ion-content [fullscreen]=true class='myMaxHeightClass'>
...enter form inputs here
</ion-content>
<ion-footer>
<p>Already have an account?</p>
<ion-button>Login</ion-button>
</ion-footer>
在 Css 檔案上(以防 fullscreen=true 不起作用):
.myMaxHeightClass {
height: calc(100vh-150px)
}
150px 是頁腳的高度。
這應該使內容全屏顯示,并且您的頁腳將在底部保持粘性。
避免使用絕對定位的頁腳按鈕,因為根據我的經驗會導致大混亂。
讓我知道這是否適合您,如果不適合,我將嘗試提出不同的方法
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/447674.html
上一篇:我可以點擊我的按鈕,它仍然激活?
