官术网_书友最值得收藏!

Miscellaneous components

There are some extra utility and miscellaneous components available in Ionic Framework. The components can be in the form of directives or services.

$ionicPosition

It is a utility service used to retrieve the position of DOM elements. This can be used to position elements absolutely over the screen. It has two methods available, position and offset, which fetch the position relative to its parent or relative to the document respectively. The methods return an object containing the properties top, left, width, and height.

$ionicConfigProvider

Ionic has a lot of default configurations and styles for different platforms. For example, in iOS, the tab bar is shown below by default, and in Android, the tab bar is shown on top. The Ionic platform exposes a provider to manage these configurations, which is called $ionicConfigProvider. This provider can be used during the config phase of your Angular app. The configuration is, by default, set for the specific platform.

The following is the usage of this variable:

var myApp = angular.module('MyApp', ['ionic']);
myApp.config(function($ionicConfigProvider) {
  $ionicConfigProvider.views.maxCache(5);
  $ionicConfigProvider.backButton.text('Go Back').icon('ion-chevron-left');
});

A list of different configurations that can be set using this provider are as follows:

  • views.transition(transition): Animation style while viewing transitions
  • scrolling.jsScrolling(booleanValue): Setting usage for native JS scrolling or not
  • backButton.icon(value): Setting the back button icon
  • backButton.text(value): Setting the text for back button
  • tabs.position(value): Setting the position of tabs out of top or bottom
  • navBar.alignTitle(value): Setting the alignment side for the navbar's title
  • spinner.icon(value): Setting the default icon for the spinner
主站蜘蛛池模板: 建宁县| 寻乌县| 肃宁县| 浏阳市| 巴彦县| 温泉县| 新建县| 垫江县| 紫阳县| 永年县| 扎鲁特旗| 白朗县| 铜梁县| 威远县| 石嘴山市| 闵行区| 淮南市| 鹿邑县| 禹州市| 鄱阳县| 富裕县| 合阳县| 鹤山市| 缙云县| 怀柔区| 格尔木市| 辰溪县| 大方县| 曲靖市| 兴隆县| 乐至县| 松滋市| 仁布县| 壶关县| 桂阳县| 枣阳市| 华宁县| 维西| 安远县| 北碚区| 喜德县|