我正在使用cordova-sms-plugin從我的ionic應用程式發送短信。當我發送較短的文本時,一切都按預期作業,但是當文本較長且短信應用程式打開時,無論我是否發送短信,回傳應用程式都會隱藏工具列。
在 Safari 中檢查時,如果我添加 padding-top from ion-safe-area-topto ,我可以看到工具列162px。
我嘗試隱藏/顯示狀態欄但沒有成功。
IOS:15
uj5u.com熱心網友回復:
現在我已經修復了一些 css。
sms(phoneNumbers: string[], message: string) {
return new Promise((resolve, reject) => {
const options = {
android: {
intent: 'INTENT',
},
};
document.body.style.height = '100%';
document.body.style.marginTop = '0px';
this.smsPlugin
.send(phoneNumbers, this.parseMessage(message), options)
.then(
() => {
resolve('success');
},
() => {
reject('error');
}
)
.finally(() => {
setTimeout(() => {
const bodyHeight = document.body.offsetHeight;
const deviceHeight = window.screen.height;
document.body.style.marginTop = bodyHeight - deviceHeight 'px';
document.body.style.height = deviceHeight 'px';
}, 200);
});
});
}
這是 Ionic Github 上報告錯誤的鏈接。
https://github.com/ionic-team/ionic-framework/issues/24135
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/345437.html
