Herewhat我试过。我已经给这个标签内跨度。但是,它不会在导航栏中显示图标。OnsenUI - 离子navicon不显示图标
<i class="ion-navicon" style="font-size:32px; vertical-align:-6px;"></i>
的index.html
<!doctype html>
<html lang="en" ng-app="my-app">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="onsenui.css"/>
<link rel="stylesheet" href="onsen-css-components.css"/>
<script src="angular.js"></script>
<script src="onsenui.js"></script>
<script>
ons.bootstrap();
</script>
<style>
.navigation-bar {
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-weight: 400;
font-size: 17px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-background-clip: padding-box;
background-clip: padding-box;
white-space: nowrap;
overflow: hidden;
word-spacing: 0;
padding: 0;
margin: 0;
font: inherit;
color: inherit;
background: transparent;
border: none;
line-height: normal;
cursor: default;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
z-index: 2;
display: block;
height: 44px;
padding-left: 0;
padding-right: 0;
background: #f8f8f8;
color: #1f1f21;
-webkit-box-shadow: none;
box-shadow: none;
border-bottom: 1px solid #ddd;
font-weight: 400;
width: 100%;
white-space: nowrap;
overflow: visible;
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.navigation-bar {
border-bottom: none;
-webkit-background-size: 100% 1px;
background-size: 100% 1px;
background-repeat: no-repeat;
background-position: bottom;
background-image: -webkit-linear-gradient(90deg, #ddd, #ddd 50%, transparent 50%);
background-image: -moz-linear-gradient(90deg, #ddd, #ddd 50%, transparent 50%);
background-image: -o-linear-gradient(90deg, #ddd, #ddd 50%, transparent 50%);
background-image: linear-gradient(0deg, #ddd, #ddd 50%, transparent 50%);
}
}
.navigation-bar__line-height {
line-height: 44px;
padding-bottom: 0;
padding-top: 0;
}
.navigation-bar__bg {
background: #f8f8f8;
}
.navigation-bar__item,
.navigation-bar__left,
.navigation-bar__right,
.navigation-bar__center {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
-webkit-background-clip: padding-box;
background-clip: padding-box;
padding: 0;
margin: 0;
font: inherit;
color: inherit;
background: transparent;
border: none;
line-height: normal;
height: 44px;
vertical-align: top;
overflow: visible;
display: block;
vertical-align: middle;
float: left;
}
.navigation-bar__left {
max-width: 50%;
width: 27%;
text-align: left;
}
.navigation-bar__right {
max-width: 50%;
width: 27%;
text-align: right;
}
.navigation-bar__center {
width: 46%;
text-align: center;
line-height: 44px;
font-size: 17px;
font-weight: 500;
}
.navigation-bar__title {
line-height: 44px;
font-size: 17px;
font-weight: 500;
color: #1f1f21;
margin: 0;
padding: 0;
overflow: visible;
}
.navigation-bar__center:first-child:last-child {
width: 100%;
}
.toolbar-button,
.toolbar-button--outline,
.toolbar-button--quiet {
font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
font-weight: 400;
font-size: 17px;
padding: 4px 10px;
letter-spacing: 0;
color: #1284ff;
text-shadow: 0 1px none;
vertical-align: baseline;
background-color: rgba(0,0,0,0);
-webkit-border-radius: 2px;
border-radius: 2px;
border: 1px solid transparent;
font-weight: 400;
font-size: 17px;
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
vertical-align: middle;
}
.toolbar-button:active,
.toolbar-button--outline:active,
.toolbar-button--quiet:active {
background-color: rgba(0,0,0,0);
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
opacity: 0.2;
}
.toolbar-button:disabled {
opacity: 0.3;
cursor: default;
pointer-events: none;
}
.toolbar-button:focus,
.toolbar-button--outline:focus,
.toolbar-button--quiet:focus {
outline: 0;
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.toolbar-button:hover,
.toolbar-button--outline:hover,
.toolbar-button--quiet:hover {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.toolbar-button--outline {
border: 1px solid #1284ff;
margin: auto 8px;
padding-left: 6px;
padding-right: 6px;
}
</style>
</head>
<body ng-controller="AppController">
<!-- Page content -->
<div class="navigation-bar navigation-bar--transparent">
<div class="navigation-bar__left">
<span class="toolbar-button--quiet navigation-bar__line-height">
<i class="ion-navicon" style="font-size:32px; vertical-align:-6px;"></i>
</span>
</div>
<div class="navigation-bar__center">
Navigation Bar
</div>
<div class="navigation-bar__right">
<span class="toolbar-button--quiet navigation-bar__line-height">Label</span>
</div>
</div>
</body>
</html>
这取决于您如何将OnsenUI集成到您的项目中。如果您使用* bower *,您会自动将ionicons _and_字体带入您的项目中。虽然乍一看这很方便,但实际上并不是最好的,因为你会得到这两个库的过时版本。 在撰写本评论的时候,您会收到字体真棒版本4.1.0(最近是4.4.0)和ionicons 2.0.0(最近2.0.1)。温泉UI团队应该真的考虑添加依赖到凉亭配置,而不是带来旧东西。这很容易,恕我直言,在这非关键。 – 2015-08-30 00:56:05