[英]Ionic <ion-item> between <ion-label> and <ion-datetime> not showing up
[英]Ionic 4, Angular: problems showing OK and Cancel buttons with <ion-datetime>, <ion-select>
我正在處理有關ionic 4的項目,但是通過將ion-datetime標簽放入我的HTML代碼中,“確定”和“取消”按鈕顯示不正確。 當我放置離子警報和離子選擇標簽時,我也會發生同樣的事情。 我顯示了詳細描述我的問題的圖像link1和link2 :
我在下面顯示HTML片段:
ion-datetime標簽的HTML片段:
<ion-item>
<ion-label position="stacked" color="primary">
<ion-text color="light">Fecha de Nacimiento</ion-text>
</ion-label>
<ion-datetime displayFormat="DD MMM YYYY" monthShortNames="ene, feb, mar, abr, may, jun, jul, ago, sep, oct, nov, dic" color="light" placeholder="Seleccione fecha" required></ion-datetime>
</ion-item>
ion-select標簽的HTML片段:
<ion-select [(ngModel)]="educa.Nivel_Academico" name="Nivel_Academico" placeholder="Nivel de Educación">
<ion-select-option value="1">Técnico</ion-select-option>
<ion-select-option value="2">Profesional</ion-select-option>
<ion-select-option value="3">Empírico</ion-select-option>
</ion-select>
我還在config.xml文件中顯示了首選項:
...
<preference name="Orientation" value="portrait" />
<preference name="android-minSdkVersion" value="19" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="StatusBarBackgroundColor" value="#6600cc" />
<preference name="StatusBarStyle" value="#FFFFFF" />
<preference name="KeyboardResize" value="true" />
<preference name="SplashScreenDelay" value="3000" />
...
</platform>
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-ionic-webview" spec="2.0.0-beta.1" />
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<plugin name="cordova-plugin-local-notification" spec="0.9.0-beta.2" />
<plugin name="cordova-sqlite-storage" spec="3.1.0" />
<plugin name="cordova-plugin-native-keyboard" spec="2.0.2">
<variable name="LICENSE" value="TRIAL" />
<variable name="LIC_ANDROID" value="TRIAL" />
</plugin>
<plugin name="cordova-plugin-camera" spec="4.0.3" />
<plugin name="cordova-plugin-file-transfer" spec="1.7.1" />
<engine name="ios" spec="^4.5.5" />
<engine name="android" spec="7.1.4" />
請讓我知道在這種情況下我做錯了什么,或者我可以采取什么解決方案。
提前致謝
您尚未在ion-select上添加okayText和cancelText屬性
<ion-select [(ngModel)]="educa.Nivel_Academico" name="Nivel_Academico" placeholder="Nivel de Educación" okText="OK" cancelText="cancel">
...
<ion-select>
而且對於日期時間,我認為您沒有正確使用屬性。 該代碼應如下所示:
<ion-datetime display-format="DD MMM YYYY" month-short-names="ene, feb, mar, abr, may, jun, jul, ago, sep, oct, nov, dic" color="light" placeholder="Seleccione fecha" required></ion-datetime>
您可以在Ionic Official Docs上找到更多詳細信息。 檢查ion-select和ion-datetime組件以獲取更多詳細信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.