微信小程序开发笔记⑫——屏幕亮度、陀螺仪、设备方向、拨打电话和振动
屏幕 小程序还提供了一些api来操作屏幕的参数,主要是屏幕的亮度 官方描述 https://developers.weixin.qq.com/miniprogram/dev/api/device/screen/wx.setScreenBrightness.html < view > < button bindtap = " screen " > 屏幕亮度 </ button > < button bindtap = " setScreen " > 设置屏幕亮度 </ button > </ view > screen : function ( ) { wx . getScreenBrightness ( { success ( res ) { console . log ( res ) } } ) } , setScreen : function ( ) { wx . setScreenBrightness ( { value : 1 , success ( ) { console . log ( "设置成功" ) } } ) } , 真机调试结果如下 陀螺仪 官方描述 https://developers.weixin.qq.com/miniprogram/dev/api/device/gyroscope/wx.stopGyroscope.html 陀螺仪和加速器有所不同