当前位置: 首页 > news >正文

网站做xss过滤wordpress 修改字体

网站做xss过滤,wordpress 修改字体,彩票app开发制作多少钱,ios编程语言是什么【HarmonyOS】鸿蒙应用如何进行页面横竖屏切换以及注意事项,自动切换横竖屏,监听横竖屏 一、鸿蒙应用如何进行页面横竖屏调用API手动切换 1.首先要在EntryAbility 中获取主窗口对象 EntryAbility.ets import { AbilityConstant, UIAbility, Want } fr…

【HarmonyOS】鸿蒙应用如何进行页面横竖屏切换以及注意事项,自动切换横竖屏,监听横竖屏

一、鸿蒙应用如何进行页面横竖屏调用API手动切换

1.首先要在EntryAbility 中获取主窗口对象
EntryAbility.ets

import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
import { window } from '@kit.ArkUI';export default class EntryAbility extends UIAbility {onWindowStageCreate(windowStage: window.WindowStage): void {// 挂载globalThis上,可以当全局对象使用。当然此处实现方式因人而异,你可以放在单例里,或者localstore中等等globalThis.windowClass = windowStage.getMainWindowSync();windowStage.loadContent('pages/RotationTestPage', (err) => {if (err.code) {return;}});}
}

之后在需要调用横竖屏切换的页面或者逻辑中调用,我这里用按钮触发举例:
RotationTestPage.ets

import { BusinessError } from '@kit.BasicServicesKit';
import { window } from '@kit.ArkUI';

struct RotationTestPage {private TAG: string = "RotationTestPage";onClickRotation = ()=>{// 设置横竖屏状态let orientation = window.Orientation.LANDSCAPE;try{globalThis.windowClass.setPreferredOrientation(orientation, (err: BusinessError) => {if(err.code){console.error(this.TAG, 'Failed to set window orientation. Cause: ' + JSON.stringify(err));return;}console.info(this.TAG,'Succeeded in setting window orientation.');});}catch (exception) {console.error(this.TAG,'Failed to set window orientation. Cause: ' + JSON.stringify(exception));}}build() {RelativeContainer() {Text("点击切换为横屏").id('RotationTestPageHelloWorld').fontSize(50).fontWeight(FontWeight.Bold).alignRules({center: { anchor: '__container__', align: VerticalAlign.Center },middle: { anchor: '__container__', align: HorizontalAlign.Center }}).onClick(this.onClickRotation)}.height('100%').width('100%')}
}

window.Orientation具体数值,参见以下网址

注意:
设置主窗口的显示方向属性。仅在支持跟随sensor旋转的设备上生效,子窗口调用后不生效。

二、如何实现应用的屏幕自动旋转

在module.json5添加属性"orientation": “auto_rotation”。

"abilities": [ { "name": "EntryAbility", "srcEntry": "./ets/entryability/EntryAbility.ets", "description": "$string:EntryAbility_desc", "icon": "$media:icon", "label": "$string:EntryAbility_label", "startWindowIcon": "$media:startIcon", "startWindowBackground": "$color:start_window_background", "exported": true, "skills": [ { "entities": [ "entity.system.home" ], "actions": [ "action.system.home" ] } ], "orientation": "auto_rotation", // 随传感器旋转 } 
]

注意:
auto_rotation随传感器旋转 需要在系统下滑菜单中,放开自动锁定状态才可生效。

三、如何监听屏幕旋转

使用媒体查询接口监听屏幕旋转

import { mediaquery } from '@kit.ArkUI'; 
let listener = mediaquery.matchMediaSync('(orientation: landscape)'); // 监听横屏事件 
function onPortrait(mediaQueryResult: mediaquery.MediaQueryResult) { if (mediaQueryResult.matches) { // do something here } else { // do something here } 
} 
listener.on('change', onPortrait) // 注册回调 
listener.off('change', onPortrait) // 去注册回调
http://www.yayakq.cn/news/395296/

相关文章:

  • 网站被重定向跳转迅睿cms建站
  • 新手网站建设教程图书一级注册安全工程师
  • idea做百度网站宁乡建设局网站
  • 区网站制作商城网站免费建设
  • 做美食没有广告的网站网站备案被退回
  • 专做衬衫的网站西安网站建设技术
  • 网站建设扌首选金手指wordpress文章列表排序
  • 备案 网站名称怎么写大连建设主管部门官方网站
  • 做网站常用的语言昆山网站
  • 网站建设中404什么意思台州高端网站设计
  • 专注微商推广的网站微信做一个小程序需要多少钱
  • 做电子的外单网站有哪些的如何推广游戏
  • 建设建设部网站网上家教网站开发
  • 网站查询地址电子商务具体是做什么的
  • 合肥网站建设优化软件开发外包要多少钱
  • 二手车网站模版网站建设空间主机的选择
  • 电子商务网站建设费用网站建设软文推广
  • 网站开发项目的里程碑移动互联网开发记事本项目告别
  • 做网站的群自己做免费手机网站吗
  • 局网站建设申请毕业纪念册设计制作图片
  • 建设公司网站的原则杭州有哪些外资企业招聘
  • html5网站制作编辑源码印刷网络商城网站建设
  • 网站制作怎么办wordpress三栏中文主题
  • 公司网站制作需要什么步骤腾讯云域名续费价格
  • 手机资讯网站源码wordpress创建标签
  • 郑州专业做网站企业襄阳网站建设兼职
  • 静态网站建设企业文化包括哪些方面内容
  • 宁波易企网做的网站网上推广哪个平台好
  • 怎样利用网站做自己的链接设计公司入川备案
  • 潍坊网站建设方案书wordpress用思源黑体