API對(duì)象

2022-06-16 18:00 更新

概述

api 對(duì)象是您入門 APICloud 必須了解和熟練掌握的一個(gè)基礎(chǔ)對(duì)象。api 對(duì)象提供了構(gòu)建應(yīng)用程序所需要的一些基本的方法[Method],如窗口操作、相冊(cè)和網(wǎng)絡(luò)數(shù)據(jù)訪問等;以及一些常見的屬性[Attribute],如屏幕寬度(screenWidth),系統(tǒng)類型(systemType)等;還有一些常用事件[Event],如電量低(batterylow)事件、應(yīng)用進(jìn)入后臺(tái)(pause)事件。api 對(duì)象不需要 require 引用,可以直接在 js 中使用。

Attribute

appId appName appVersion systemType
systemVersion version language deviceId
deviceToken deviceModel deviceName uiMode
platform operator connectionType fullScreen
screenWidth screenHeight winName winWidth
winHeight frameName frameWidth frameHeight
safeArea pageParam wgtParam appParam
statusBarAppearance wgtRootDir fsDir cacheDir
boxDir debug channel jailbreak
isRecoveryMode

Constant

toast位置 傳感器類型 電話類型 定位精度
動(dòng)畫類型 動(dòng)畫曲線類型 動(dòng)畫子類型 進(jìn)度提示框動(dòng)畫類型
進(jìn)度提示框風(fēng)格 媒體類型 拾取器類型 圖片編碼類型
圖片數(shù)據(jù)格式 圖片源類型 網(wǎng)絡(luò)類型 文件操作錯(cuò)誤碼
系統(tǒng)類型 下載狀態(tài) 異步請(qǐng)求錯(cuò)誤類型 異步請(qǐng)求返回?cái)?shù)據(jù)類型
異步請(qǐng)求方法類型 狀態(tài)欄樣式 屏幕旋轉(zhuǎn)方向 錯(cuò)誤碼
上傳狀態(tài) 鍵盤彈出頁面調(diào)整方式 緩存策略

event

apiready batterylow batterystatus keyback
keymenu volumeup volumedown offline
online pause resume active
inactive scrolltobottom backtotop shake
takescreenshot appidle swipedown swipeleft
swiperight swipeup tap longpress
viewappear viewdisappear noticeclicked appintent
smartupdatefinish launchviewclicked keyboardshow keyboardhide
safeareachanged interfacestylechanged navtitle navbackbtn
navitembtn tabitembtn tabframe

method

窗口系統(tǒng)

openWin closeWin closeToWin windows
setWinAttr openFrame closeFrame frames
setFrameAttr bringFrameToFront sendFrameToBack setFrameClient
animation openFrameGroup closeFrameGroup setFrameGroupAttr
setFrameGroupIndex openPopoverWin closePopoverWin openSlidLayout
openSlidPane closeSlidPane lockSlidPane unlockSlidPane
openDrawerLayout openDrawerPane closeDrawerPane loadData
execScript setBlurEffect removeLaunchView showLaunchView
parseTapmode

高級(jí)窗口

openTabLayout setTabLayoutAttr setNavBarAttr getNavBarAttr
setTabBarAttr setTabBarItemAttr

應(yīng)用管理

installApp uninstallApp openApp appInstalled
rebootApp openWidget closeWidget

網(wǎng)絡(luò)通信

ajax cancelAjax download cancelDownload
imageCache applyCertificates

數(shù)據(jù)存儲(chǔ)

readFile writeFile setPrefs getPrefs
removePrefs setGlobalData getGlobalData clearCache
getCacheSize getTotalSpace getFreeDiskSpace loadSecureValue

消息事件

addEventListener removeEventListener sendEvent accessNative
notification cancelNotification

設(shè)備訪問

startLocation stopLocation getLocation startSensor
stopSensor call sms mail
openContacts setFullScreen setStatusBarStyle setScreenOrientation
setKeepScreenOn toLauncher setScreenSecure setAppIconBadge
getPhoneNumber hasPermission requestPermission getInterfaceStyle
setInterfaceStyle

UI組件

alert confirm prompt actionSheet
showProgress hideProgress toast openPicker
setRefreshHeaderInfo setCustomRefreshHeaderInfo refreshHeaderLoading refreshHeaderLoadDone
showFloatBox setMenuItems

多媒體

getPicture saveMediaToAlbum screenCapture startRecord
stopRecord startPlay pausePlay stopPlay
openVideo

應(yīng)用管理

require

應(yīng)用管理

historyBack historyForward

應(yīng)用管理

pageUp pageDown setFocus
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)