我想知道如何通过向下滚动页面来隐藏 Ionic 4 中的标题,并在向上滚动时重新显示它。
我找到了很多关于如何做到这一点的解决方案,但它们都无法正常工作或已过时。
所以我收集了我能找到的所有信息来提供这个答案。
我已经编写了一个Angular 4 Material 2应用程序,一切都在Chrome中工作正常,但在Internet Explorer上页面是空的.我已经添加了一个<h1>到index.html,但是在我的content.component.html中添加一个不起作用,甚至整个组件的代码也没有添加到DOM中.
index.html(<h1>Test</h1>在IE中显示):
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>ITEM Projekte</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic">
</head>
<body>
<h1>Test</h1>
<app-root></app-root>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
app.component.html(<h1>Test</h1>未在IE中显示):
<h1>Test</h1>
<md-card>
<md-card-title>ITEM Projekt anlegen</md-card-title>
<md-card-subtitle>PROJEKTDATEN</md-card-subtitle>
<md-card-content>
<div style="width: 100%; ">
<md-input-container *ngFor="let item of projektdaten" style="margin-right: 15px; display: inline-block; ">
<label style="width: 120px; display: block;">{{item.identifier}}:</label><input mdInput name={{item.identifier}} style="width: 150px; " (keyup)="setProjectData(item, …Run Code Online (Sandbox Code Playgroud) 如果我在导航栏中对齐我的图标display: flex,则会在我的图标下方显示下划线.如果我禁用它,它们会消失,但我的图标没有正确对齐.见下图.
我怎么能摆脱他们?
这是代码:
.nav {
width: 60px;
height: 100vh;
top: 100px;
min-height: 100vh;
background-color: #cccccc;
position: fixed;
z-index: 999;
opacity: .4;
border-right: 1px solid black;
display: flex;
flex-direction: column;
}
.nav a {
width: 100%;
height: 60px;
display: flex;
justify-content: center;
align-items: center;
border: none;
}Run Code Online (Sandbox Code Playgroud)
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="nav">
<a href=""><i class="material-icons">home</i></a>
<a href=""><i class="material-icons">shopping_basket</i></a>
<a href=""><i class="material-icons">business</i></a>
<a href=""><i class="material-icons">mail</i></a>
<a href=""><i class="material-icons">card_giftcard</i></a>
</div>Run Code Online (Sandbox Code Playgroud)