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

企业网站 更新 seo手机创建网站教程

企业网站 更新 seo,手机创建网站教程,东莞php网站开发,酒店家具网站源码1、HarmonyOS 只调用根节点的dispose,是否其下的子节点都能析构掉还是需要遍历子节点,都执行dispose才能正常析构? 前端持有引用关系的需要dispose,new出来的builderNode和FrameNode也需要dispose。只调用根节点的dispose,无法保证其下的子节…
1、HarmonyOS 只调用根节点的dispose,是否其下的子节点都能析构掉还是需要遍历子节点,都执行dispose才能正常析构?

前端持有引用关系的需要dispose,new出来的builderNode和FrameNode也需要dispose。只调用根节点的dispose,无法保证其下的子节点能够正常释放

2、HarmonyOS 如何在Web UserAgent中区分手机设备与pad设备?

参考:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/multi-faq-V5#ZH-CN_TOPIC_0000001884757262__%E5%A6%82%E4%BD%95%E6%9F%A5%E8%AF%A2%E8%AE%BE%E5%A4%87%E7%B1%BB%E5%9E%8B

  1. 通过命令行的方式查询设备类型。
    通过命令行查询指定系统参数(const.product.devicetype)进而确定设备类型
 # 方法一hdc shell param get "const.product.devicetype"# 方法二hdc shell cat /etc/param/ohos.para | grep const.product.devicetype
  1. 在应用开发过程中查询设备类型。
 import { deviceInfo } from'@kit.BasicServicesKit'@Entry@Componentstruct GetDeviceTypeSample {@State deviceType:string='unknown'aboutToAppear() {this.deviceType= deviceInfo.deviceType}build() {Column() {Text(this.deviceType).fontSize(24)}.width('100%').height('100%')}
}
3、HarmonyOS Navigation路由问题?

在Index页面跳转PageOne页面的同时隐藏了导航页(hideNavBar),但是在PageOne页面返回上一页时,为什么会出现白屏的情况?

// Index.ets
@Entry
@Component
struct Index {@State hideNavBar: boolean = falseprivate pageStack: NavPathStack = new NavPathStack()build() {Navigation(this.pageStack) {Column() {Button('跳转PageOne,隐藏NavBar').onClick(() => {this.hideNavBar = truethis.pageStack.replacePath({name: 'PageOne'})})}.height('100%').justifyContent(FlexAlign.Center)}.hideNavBar(this.hideNavBar).hideTitleBar(true).hideBackButton(true)}
}// PageOne.ets
@Builder
function PageOneBuilder() {PageOne()
}@Component
export struct PageOne {pageStack: NavPathStack | null = nullbuild() {NavDestination() {Column() {Button('返回上一页').onClick(() => {// 这里返回上一页this.pageStack?.pop?.()})}.height('100%')}.hideTitleBar(true).onReady((ctx: NavDestinationContext) => {this.pageStack = ctx.pathStack})}
}

api介绍:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/arkts-navigation-navigation-V5

白屏的情况是隐藏了导航页Navigation导致 hideNavBar(true),设置为false回去就能看到上一个界面的导航页按钮。可以在Navigation上加一个button组件,在返回即使隐藏了Navigation也能看到button组件。具体使用再参考下api文档。

4、HarmonyOS Tabs组件宽度问题?

文档显示Tabs组件的指示器和视图的宽度一样,app首页的会有很多栏目,在栏目的右边会有一个半透明的遮盖条和一个按钮,在这里有办法分开写吗?或者有其他的组件可以替代,这个会影响操作,最后的一两个栏目可能会点不到。

参考以下demo:

@Entry
@Component
struct tabTest {@State tabArray: Array<number> = [0, 1, 2, 3,4]@State focusIndex: number = 0@State pre: number = 0@State index: number = 0private controller: TabsController = new TabsController()@State test: boolean = false@State animationDuration: number = 300@State indicatorLeftMargin: number = 0@State indicatorWidth: number = 0private tabsWidth: number = 0private tabWidth: number = 0;private scrollerForScroll: Scroller = new Scroller()// 单独的页签@BuilderTab(tabName: string, tabItem: number, tabIndex: number) {Row({ space: 20 }) {Text(tabName).fontSize(18).fontColor(tabIndex === this.focusIndex ? Color.Blue :Color.Black).id(tabIndex.toString()).onAreaChange((oldValue: Area,newValue: Area) => {if (this.focusIndex === tabIndex && (this.indicatorLeftMargin === 0 || this.indicatorWidth === 0)){if (newValue.position.x != undefined) {let positionX = Number.parseFloat(newValue.position.x.toString())this.indicatorLeftMargin = Number.isNaN(positionX) ? 0 : positionX}let width = Number.parseFloat(newValue.width.toString())this.tabWidth = Number.isNaN(width) ? 0 : widththis.indicatorWidth = this.tabWidth}})}.justifyContent(FlexAlign.Center).constraintSize({ minWidth: 35 }).width(100).height(30).onClick(() => {this.controller.changeIndex(tabIndex)this.focusIndex = tabIndex}).backgroundColor("#ffb7b7b7")}@BuildertextTest(textName:string){Row({ space: 20 }) {Text(textName).fontSize(18)}.justifyContent(FlexAlign.Center).constraintSize({ minWidth: 35 }).height(30).backgroundColor("#ffb7b7b7")}build() {Column() {Stack({ alignContent: Alignment.TopStart }) {Column() {// 页签Row({ space: 8 }) {List({ space: 20, initialIndex: 0, scroller: this.scrollerForScroll }) {ForEach(this.tabArray, (item: number, index: number) => {ListItem() {this.Tab("页签 " + item, item, index)}}, (item: string) => item)}.listDirection(Axis.Horizontal).height(30).width('80%').friction(0.6).alignListItem(ListItemAlign.Start).scrollBar(BarState.Off).width('80%').backgroundColor("#ffb7b7b7").onScroll((xOffset: number, yOffset: number) => {this.indicatorLeftMargin -= xOffset})this.textTest('更多')}.alignItems(VerticalAlign.Bottom).width('100%').backgroundColor("#ffb7b7b7")}.alignItems(HorizontalAlign.Start).width('100%')Column().height(2).width(this.indicatorWidth).margin({ left: this.indicatorLeftMargin, top:30}).backgroundColor(Color.Blue)Column().height(10).width("20%").margin({ left: '80%', top:28}).backgroundColor("#ffb7b7b7")}.height(40).width('100%').backgroundColor("#ffb7b7b7")//tabsTabs({ barPosition: BarPosition.Start, controller: this.controller }) {ForEach(this.tabArray, (item: number, index: number) => {TabContent() {Text('我是页面 ' + item + " 的内容").height(300).width('100%').fontSize(30)}.backgroundColor(Color.White)}, (item: string) => item)}.onAreaChange((oldValue: Area,newValue: Area)=> {let width = Number.parseFloat(newValue.width.toString())this.tabsWidth = Number.isNaN(width) ? 0 : width}).width('100%').barHeight(0).animationDuration(100).onChange((index: number) => {console.log('foo change')this.focusIndex = indexthis.scrollerForScroll.scrollToIndex(index-1,true)}).onAnimationStart((index: number, targetIndex: number, event: TabsAnimationEvent) => {// 切换动画开始时触发该回调。下划线跟着页面一起滑动this.focusIndex = targetIndexlet targetIndexInfo = this.getTextInfo(targetIndex)this.startAnimateTo(this.animationDuration, targetIndexInfo.left, targetIndexInfo.width)}).onAnimationEnd((index: number,event: TabsAnimationEvent) => {// 切换动画结束时触发该回调。下划线动画停止。let currentIndicatorInfo = this.getCurrentIndicatorInfo(index,event)this.startAnimateTo(0,currentIndicatorInfo.left,currentIndicatorInfo.width)}).onGestureSwipe((index: number,event: TabsAnimationEvent) => {// 在页面跟手滑动过程中,逐帧触发该回调。let currentIndicatorInfo = this.getCurrentIndicatorInfo(index,event)this.focusIndex = currentIndicatorInfo.indexthis.indicatorLeftMargin = currentIndicatorInfo.leftthis.tabWidth = currentIndicatorInfo.widththis.indicatorWidth = currentIndicatorInfo.width})}.height('100%')}private getTextInfo(index: number): Record<string, number> {let strJson = getInspectorByKey(index.toString())try {let obj: Record<string, string> = JSON.parse(strJson)let rectInfo: number[][] = JSON.parse('[' + obj.$rect + ']')return { 'left': px2vp(rectInfo[0][0]), 'width': px2vp(rectInfo[1][0] - rectInfo[0][0]) }} catch (error) {return { 'left': 0, 'width': 0 }}}private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record<string, number> {let nextIndex = indexif (index > 0 && event.currentOffset > 0) {nextIndex--} else if (index < 4 && event.currentOffset < 0) {nextIndex++}let indexInfo = this.getTextInfo(index)let nextIndexInfo = this.getTextInfo(nextIndex)let swipeRatio = Math.abs(event.currentOffset / this.tabsWidth)let currentIndex = swipeRatio > 0.5 ? nextIndex : index  // 页面滑动超过一半,tabBar切换到下一页。let currentLeft = indexInfo.left + (nextIndexInfo.left - indexInfo.left) * swipeRatiolet currentWidth = indexInfo.width + (nextIndexInfo.width - indexInfo.width) * swipeRatioreturn { 'index': currentIndex, 'left': currentLeft, 'width': currentWidth }}private startAnimateTo(duration: number, leftMargin: number, width: number) {animateTo({duration: duration, // 动画时长curve: Curve.Linear, // 动画曲线iterations: 1, // 播放次数playMode: PlayMode.Normal, // 动画模式onFinish: () => {console.info('play end')}}, () => {this.indicatorLeftMargin = leftMarginthis.tabWidth = widththis.indicatorWidth = width})}
}
5、HarmonyOS 如何监听Map?

可以用@State来修饰Map变量,现在支持Map、Set类型 但是不支持HashMap。


文章转载自:
http://glomerate.stph.cn
http://posthouse.stph.cn
http://intermigration.stph.cn
http://buckra.stph.cn
http://calamary.stph.cn
http://undying.stph.cn
http://biocrat.stph.cn
http://coindication.stph.cn
http://bpi.stph.cn
http://sussy.stph.cn
http://ichor.stph.cn
http://mel.stph.cn
http://dichloride.stph.cn
http://actionless.stph.cn
http://infusionism.stph.cn
http://vietnamize.stph.cn
http://contestant.stph.cn
http://carposporangium.stph.cn
http://alchemic.stph.cn
http://supernormal.stph.cn
http://dolefully.stph.cn
http://veld.stph.cn
http://brachylogy.stph.cn
http://nursery.stph.cn
http://polyantha.stph.cn
http://hellenist.stph.cn
http://electromotive.stph.cn
http://illicitly.stph.cn
http://capsizal.stph.cn
http://choreman.stph.cn
http://amice.stph.cn
http://pimiento.stph.cn
http://sungar.stph.cn
http://knacky.stph.cn
http://digitally.stph.cn
http://textured.stph.cn
http://thitherward.stph.cn
http://glarney.stph.cn
http://pelorus.stph.cn
http://epistasy.stph.cn
http://backstabber.stph.cn
http://rhizome.stph.cn
http://graip.stph.cn
http://monochasium.stph.cn
http://macbeth.stph.cn
http://swelter.stph.cn
http://lumpen.stph.cn
http://detrude.stph.cn
http://outrush.stph.cn
http://vrml.stph.cn
http://buteshire.stph.cn
http://instinctual.stph.cn
http://thromboembolus.stph.cn
http://hellhole.stph.cn
http://belle.stph.cn
http://breathhold.stph.cn
http://xerodermia.stph.cn
http://proportionable.stph.cn
http://uncompromisable.stph.cn
http://watchman.stph.cn
http://liverpool.stph.cn
http://nsec.stph.cn
http://expectorant.stph.cn
http://tourniquet.stph.cn
http://gastralgia.stph.cn
http://leglen.stph.cn
http://revaccinate.stph.cn
http://lieve.stph.cn
http://sumbawa.stph.cn
http://savorily.stph.cn
http://eca.stph.cn
http://passant.stph.cn
http://download.stph.cn
http://returf.stph.cn
http://guidelines.stph.cn
http://payer.stph.cn
http://pact.stph.cn
http://legendarily.stph.cn
http://sylph.stph.cn
http://cothurn.stph.cn
http://autumn.stph.cn
http://fevered.stph.cn
http://sensitively.stph.cn
http://phospholipin.stph.cn
http://adrienne.stph.cn
http://supportability.stph.cn
http://debride.stph.cn
http://trombone.stph.cn
http://breughel.stph.cn
http://numbering.stph.cn
http://hecatonchires.stph.cn
http://hymnal.stph.cn
http://cercopithecoid.stph.cn
http://hippophagy.stph.cn
http://ruined.stph.cn
http://recross.stph.cn
http://aquafarm.stph.cn
http://floss.stph.cn
http://mirable.stph.cn
http://immission.stph.cn
http://www.15wanjia.com/news/99041.html

相关文章:

  • 建行手机网站网址是多少钱网络服务器的功能
  • 自己做的网站怎样赚钱吗免费b站推广网址有哪些
  • 北京文化传媒有限公司网站建设b站推广入口
  • wordpress文章页调用分类列表神马seo服务
  • 个体户忘了年报是否罚款桂林seo顾问
  • 定制网站开发平台免费刷推广链接的网站
  • 交互效果网站企业关键词优化最新报价
  • 自己建个网站需要什么鱼头seo软件
  • 淘宝网站开发百度排名点击软件
  • 商城网站 模板深圳网站开发
  • 医院网站建设策划市场调查报告模板及范文
  • 网站上传图片不成功推广信息怎么写
  • 上海武汉阳网站建设广东省白云区
  • wordpress 账户及密码东莞seo快速排名
  • 怎么在搜索引擎做网站登记什么是网站推广
  • wordpress published长沙seo优化推广公司
  • 广州专门做网站如何购买域名
  • 手机门户网站开发优化设计五年级下册数学答案
  • wordpress首页动画设置宁波seo排名费用
  • 一个专门做预告片的网站百度在线下载
  • 温州做美食网站指数函数
  • 无锡网站公司哪家好营销推广文案
  • 做网贷网站多少钱上海培训机构排名
  • 帮朋友做网站 知乎军事新闻最新24小时
  • 兼职做国外网站钻前社会化媒体营销
  • 手把手教你搭建自己的网站推广引流工具
  • 有做的小说网站设计培训学院
  • 做网站的费用是多少电商培训课程
  • 17网一起做网店网站模板建站公司
  • 网站制作top班级优化大师学生版