小编Ric*_*all的帖子

如何检测是否在新的 Windows 终端中运行?

Windows 终端预览版即将推出的一个功能是它具有完整的表情符号支持:

在 Windows 终端中运行的 Windows Powershell

相比:

Windows Powershell

在 Node.js 中,如何检测我是否在 Windows 终端(而不是其“裸”变体)包装的终端中运行?是否有我可以提取的环境变量或可以进行同步测试?

javascript windows terminal node.js windows-terminal

9
推荐指数
1
解决办法
2198
查看次数

如何使用react-map-gl在两点之间画线

我正在尝试使用react-map-gl 库在两点之间画一条线。我无法从官方文档中找到示例,因此我尝试从以下使用 Mapbox 库的代码片段中重现相同的行为

var map = new mapboxgl.Map({
    container: 'map',
    style: 'mapbox://styles/mapbox/streets-v11',
    center: [-122.486052, 37.830348],
    zoom: 15
});

map.on('load', function() {
    map.addSource('route', {
        'type': 'geojson',
        'data': {
            'type': 'Feature',
            'properties': {},
            'geometry': {
                'type': 'LineString',
                'coordinates': [
                    [-122.483696, 37.833818],

                    [-122.493782, 37.833683]
                ]
            }
        }
    });
    map.addLayer({
        'id': 'route',
        'type': 'line',
        'source': 'route',
        'layout': {
            'line-join': 'round',
            'line-cap': 'round'
        },
        'paint': {
            'line-color': '#888',
            'line-width': 8
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

这是沙箱,我在控制台上没有看到任何错误,但未显示该行:
https://codesandbox.io/s/draw-line- Between-two-point-v0mbc?file=/src/index。 js:214-226

mapbox-gl-js react-map-gl

8
推荐指数
1
解决办法
6999
查看次数

6
推荐指数
1
解决办法
718
查看次数

在移动设备上滚动时,CSS 全屏背景在底部显示白条

我有一个全屏背景图片的网站。

html, body {
  height: 100vh;
}

html {
  background: url('/img/background.jpg') no-repeat center center fixed;
  background-size: cover;
}
Run Code Online (Sandbox Code Playgroud)

此代码在大多数设备上运行良好,但在一些旧的 Android 设备上,向下滚动时会导致问题。部分向下滚动但不松开手指会显示一个与 URL 栏大小相同的白色栏,同时消失。一旦你松开手指,背景就会自行修复。

这就是图像在滚动中的样子。

网站截图

有没有办法确保背景总是填满页面?


编辑:我还尝试添加具有这些属性的 div:

#background {
  background: url('/img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  z-index: -100;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200vh;
}
Run Code Online (Sandbox Code Playgroud)

这显示了背景,但发生了同样的问题。

html css background

6
推荐指数
1
解决办法
733
查看次数

如何转换为kotlin window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR

如何将此代码转换为 Kotlin?

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
}
setContentView(R.layout.activity_login)
Run Code Online (Sandbox Code Playgroud)

当我尝试时,出现以下警告:

systemUiVisibility: Int' 的 setter 已弃用。Java 中已弃用“SYSTEM_UI_FLAG_LIGHT_STATUS_BAR: Int”已弃用。在 Java 中已弃用

java android kotlin

0
推荐指数
1
解决办法
2684
查看次数