Categories: ionic 教程

ionic JavaScript头部和底部

ion-header-bar

这个是固定在屏幕顶部的一个头部标题栏。如果给它加上bar-subheader 这个样式,它就是副标题。

用法

<ion-header-bar align-title="left" class="bar-positive">
  <div class="buttons">
    <button class="button" ng-click="doSomething()">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons">
    <button class="button">Right Button</button>
  </div>
</ion-header-bar>
<ion-content>
  Some content!
</ion-content>

API

属性 类型 描述
align-title
(optional)
string 这个是对齐 title 的。如果没有设置,它将会按照手机的默认排版(Ios的默认是居中,Android默认是居左)。它的值可以是 left,center,right。
no-tap-scroll
(optional)
boolean 默认情况下,头部标题栏在点击屏幕时内容会滚动到头部,可以将 no-tap-scroll 设置为 true 来禁止该动作。。它的值是布尔值(true/false)。

ion-footer-bar

知道了 ion-header-bar ,理解ion-footer-bar就轻松多啦!只是 ion-footer-bar 是在屏幕的底部。

用法

<ion-content>
  Some content!
</ion-content>
<ion-footer-bar align-title="left" class="bar-assertive">
  <div class="buttons">
    <button class="button">Left Button</button>
  </div>
  <h1 class="title">Title!</h1>
  <div class="buttons" ng-click="doSomething()">
    <button class="button">Right Button</button>
  </div>
</ion-footer-bar>

API

与 ion-header-bar 不同的是,ion-footer-bar 只有 align-title 这个 API。

属性 类型 描述
align-title
(optional)
string 这个是对齐 title 的。如果没有设置,它将会按照手机的默认排版(Ios的默认是居中,Android默认是居左)。它的值可以是 left,center,right。
唐伯虎点蚊香

前端小白,想各位学习!

Share
Published by
唐伯虎点蚊香

Recent Posts

在 Chrome 中删除、允许和管理 Cookie

您可以选择删除现有 Cooki…

1 天 ago

自定义指令:聊聊vue中的自定义指令应用法则

今天我们来聊聊vue中的自定义…

1 周 ago

聊聊Vue中@click.stop和@click.prevent

一起来学下聊聊Vue中@cli…

2 周 ago

Nginx 基本操作:启动、停止、重启命令。

我们来学习Nginx基础操作:…

3 周 ago

Vue3:手动清理keep-alive组件缓存的方法

Vue3中手动清理keep-a…

3 周 ago

聊聊React和Vue组件更新的实现及区别

React 和 Vue 都是当…

4 周 ago