我一直在嘗試構建響應式導航欄,並且不希望使用媒體查詢,所以我打算使用屏幕分辨率爲*ngIF
作爲標準。 但一直面臨問題,因爲我無法找到有關Angular 4屏幕分辨率檢測的任何方法或文檔。我也嘗試了JavaScript方法,但不支持。使用角度檢測屏幕分辨率4
我也曾嘗試following:
constructor(platform: Platform) {
platform.ready().then((readySource) => {
console.log('Width: ' + platform.width());
console.log('Height: ' + platform.height());
});
}
這是在離子
使用和screen.availHeight
但仍然沒有成功。
什麼是「平臺」?這是關於離子嗎? –
@GünterZöchbauer該平臺是有棱角的,只是想提一下我試過的代碼。 – Ronit
['平臺'](https://ionicframework.com/docs/api/platform/Platform)是一種離子服務。所以我猜這是一個離子項目? – robbannn