- Ionic:Hybrid Mobile App Development
- Rahat Khanna Sani Yusuf Hoc Phan
- 247字
- 2021-07-09 19:00:37
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 transitionsscrolling.jsScrolling(booleanValue)
: Setting usage for native JS scrolling or notbackButton.icon(value)
: Setting the back button iconbackButton.text(value)
: Setting the text for back buttontabs.position(value)
: Setting the position of tabs out of top or bottomnavBar.alignTitle(value)
: Setting the alignment side for the navbar's titlespinner.icon(value)
: Setting the default icon for the spinner
- 摩登創(chuàng)客:與智能手機和平板電腦共舞
- Web Application Development with MEAN
- 零基礎(chǔ)入門學(xué)習(xí)Python
- 區(qū)塊鏈底層設(shè)計Java實戰(zhàn)
- Learning Continuous Integration with TeamCity
- 零基礎(chǔ)學(xué)Kotlin之Android項目開發(fā)實戰(zhàn)
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- 創(chuàng)意UI:Photoshop玩轉(zhuǎn)APP設(shè)計
- Learning iOS Security
- Android Studio Cookbook
- 嵌入式Linux C語言程序設(shè)計基礎(chǔ)教程
- 游戲設(shè)計的底層邏輯
- 前端架構(gòu)設(shè)計
- C語言王者歸來
- JavaScript程序設(shè)計基礎(chǔ)教程(慕課版)