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

wdcp网站无法访问如何设计一个网页页面

wdcp网站无法访问,如何设计一个网页页面,章贡区综合网站建设商家,wordpress 4.0 中文版【HarmonyOS】鸿蒙应用如何进行页面横竖屏切换以及注意事项#xff0c;自动切换横竖屏#xff0c;监听横竖屏 一、鸿蒙应用如何进行页面横竖屏调用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;Entry Component 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.dnsts.com.cn/news/171151.html

相关文章:

  • 上海公司网站备案中国设计师网app
  • 网站建设树状图网络营销工具主要类型有
  • 南宁做网站建设北海哪家做网站
  • 苏州企业网站建设设计网站设计公司 上
  • 百度认证营销推广师seo关键词优化软件官网
  • 有什么做户外活动的网站吗wordpress获取指定id分类名称
  • 哪里有网络课程平台网站_就是帮老师建设一个教学的网站在线解压缩网站
  • 公司建设网站价格表wordpress手机接口
  • 给公司怎么做官方网站西北网站建设
  • 国外手机网站设计苏州优化网站
  • 郑州网站建设的公司网络营销是什么的基础选择题
  • 网站开发成本销售网站建设
  • 认证空间如何显示网站中国企业500强排行榜完整榜单
  • 公司网站开发费入什么科目制作书签简单又漂亮
  • 设计网站需要考虑哪些博物馆门户网站建设优势
  • 网站建设最新外文翻译企业网页申请制作步骤
  • 深圳网站建设zhaoseo百度智能创作平台
  • 网站开发 企业宣传册微信公众号制作模板免费
  • 网站建设这个顺义做网站同学
  • 网站建设初级教程企业做网站收入
  • 手机网站建立免费平台百度地图排名可以优化吗
  • 石家庄做网站备案有哪些公司品牌广告公司网站建设
  • 定制营销型网站制作百度统计怎么用
  • 做网站最简单娄底网站优化
  • 网站规划和建设的基本要求新型网站设计
  • 做期货看资讯什么网站好品牌策划咨询设计公司
  • 网站开发课程设计体会用ps做糖果店网站模板
  • 商务网站的推广网站宝 添加二级域名
  • 网站提交工具安卓wordpress客户端
  • 律师在哪个网站做推广好公司网站的建设怎么做