我一直在try 构建一个响应迅速的导航栏,不希望使用媒体查询,因此我打算使用窗口大小为*ngIf
作为标准.
但我一直面临着一个问题,因为我找不到任何关于角4窗口大小检测的方法或文档.我也try 过JavaScript方法,但不支持.
我也试过following:
constructor(platform: Platform) {
platform.ready().then((readySource) => {
console.log('Width: ' + platform.width());
console.log('Height: ' + platform.height());
});
}
.这是用在ionic 型的.
和screen.availHeight
个,但仍然没有成功.