[英]Ionic ion-view title not showing
I am relatively new to Ionic and I'm trying to make a simple login page. 我是Ionic的新手,我正在尝试制作一个简单的登录页面。 However when i put it won't show a header bar. 但是,当我说它不会显示标题栏。 Does anyone have any idea what i do wrong? 有谁知道我做错了什么?
<ion-view view-title="Sign-In">
<ion-content>
<div class="list">
<label class="item item-input">
<span class="input-label">Username</span>
<input type="text" ng-model="user.username">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="password" ng-model="user.password">
</label>
</div>
<div class="padding">
<button class="button button-block button-positive" ng- click="signIn(user)">
Sign-In
</button>
<p class="text-center">
<a href="#/forgot-password">Forgot password</a>
</p>
</div>
</ion-content>
</ion-view>
You haven't written the html for the header. 您尚未为标头编写html。 You need to add a div with the class="bar bar-header"
to display the header. 您需要添加一个带有class="bar bar-header"
的div来显示标题。
<ion-view view-title="Sign-In">
<div class="bar bar-header bar-light">
<h1 class="title">Header</h1>
</div>
<ion-content class="has-header">
<div class="list">
<label class="item item-input">
<span class="input-label">Username</span>
<input type="text" ng-model="user.username">
</label>
<label class="item item-input">
<span class="input-label">Password</span>
<input type="password" ng-model="user.password">
</label>
</div>
<div class="padding">
<button class="button button-block button-positive" ng-click="signIn(user)">
Sign-In
</button>
<p class="text-center">
<a href="#/forgot-password">Forgot password</a>
</p>
</div>
</ion-content>
</ion-view>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.