中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

東方網(wǎng)站建設(shè)百度打開百度搜索

東方網(wǎng)站建設(shè),百度打開百度搜索,系統(tǒng)定制開發(fā),企業(yè)網(wǎng)站開發(fā)職責前言: 各位同學(xué)有段時間沒有見面 因為一直很忙所以就沒有去更新博客。最近有在學(xué)習這個鴻蒙的ark ui開發(fā) 因為鴻蒙不是發(fā)布了一個鴻蒙next的測試版本 明年會啟動純血鴻蒙應(yīng)用 所以我就想提前給大家寫一些博客文章 效果圖 具體實現(xiàn) 我們在鴻蒙的ark ui 里面列表使…

前言:

各位同學(xué)有段時間沒有見面 因為一直很忙所以就沒有去更新博客。最近有在學(xué)習這個鴻蒙的ark ui開發(fā) 因為鴻蒙不是發(fā)布了一個鴻蒙next的測試版本 明年會啟動純血鴻蒙應(yīng)用 所以我就想提前給大家寫一些博客文章

效果圖

具體實現(xiàn)

我們在鴻蒙的ark ui 里面列表使用我們的Swiper組件來實現(xiàn) 我們的輪播圖

準備數(shù)據(jù)源

import { PictureItem } from '../bean/PictureItem';/*** Pictures of banner.*/
export const PICTURE_BANNER: PictureItem[] = [{ 'id': '1', 'name': '怒海', 'description': '怒海波濤', 'image': $r('app.media.image1') },{ 'id': '2', 'name': '大山深處', 'description': '大山深處感人的親情之歌', 'image': $r('app.media.image2') },{ 'id': '3', 'name': '荒漠', 'description': '荒漠的親情之歌', 'image': $r('app.media.image3') }
];/*** type of pictures.*/
export enum PictureType {BANNER = 'banner',
}

Bean類


/*** Picture entity class.*/
export class PictureItem {id: string;name: string;description: string;image: Resource;constructor(id: string, name: string, description: string, image: Resource) {this.id = id;this.name = name;this.description = description;this.image = image;}
}

寬高常量配置


/*** Common constants for all features.*/
export class CommonConstants {/*** animation duration of tab content switching.*/static readonly DURATION_ADS = 200;/*** height of carousel title.*/static readonly HEIGHT_CAROUSEL_TITLE = 90;/*** fontSize of description.*/static readonly FONT_SIZE_DESCRIPTION = 12;/*** font size of title.*/static readonly FONT_SIZE_TITLE = 20;static readonly FONT_WEIGHT_LIGHT = 400;/*** bold font.*/static readonly FONT_WEIGHT_BOLD = 700;/*** page layout weight.*/static readonly LAYOUT_WEIGHT = 1;/*** border angle.*/static readonly BORDER_RADIUS = 12;/*** line height for more.*/static readonly LINE_HEIGHT_MORE = 19;/*** rolling duration.*/static readonly SWIPER_TIME = 1500;/*** margin of text bottom.*/static readonly BOTTOM_TEXT = 4;/*** margin of banner top.*/static readonly TOP_ADS = 12;/*** margin of banner left.*/static readonly ADS_LEFT = 12;/** maximum width.*/static readonly FULL_WIDTH = '100%';/*** maximum height.*/static readonly FULL_HEIGHT = '100%';/*** width of tab page.*/static readonly PAGE_WIDTH = '100%';/*** height of banner.*/static readonly HEIGHT_BANNER = '27%';}

具體布局


import router from '@ohos.router';
import { PictureItem } from '../bean/PictureItem';
import { PictureType } from '../constants/PictureConstants';
import { initializePictures, startPlay, stopPlay } from './PictureViewModel';
import { CommonConstants } from '../constants/CommonConstant';@Extend(Text) function textStyle(fontSize: number, fontWeight: number) {.fontSize(fontSize).fontColor($r('app.color.start_window_background')).fontWeight(fontWeight)
}/*** Carousel banner.*/
@Component
export struct Banner {@State index: number = 0;private imageArray: Array<PictureItem> = [];private swiperController: SwiperController = new SwiperController();aboutToAppear() {// Data Initialization.this.imageArray = initializePictures(PictureType.BANNER);// Turn on scheduled task.startPlay(this.swiperController);}aboutToDisappear() {stopPlay();}build() {Swiper(this.swiperController) {ForEach(this.imageArray, item => {Stack({ alignContent: Alignment.TopStart }) {Image(item.image).objectFit(ImageFit.Fill).height(CommonConstants.FULL_HEIGHT).width(CommonConstants.FULL_WIDTH).borderRadius(CommonConstants.BORDER_RADIUS).align(Alignment.Center).onClick(() => {console.log("點擊事件 item"+item.id)})Column() {Text($r('app.string.movie_classic')).textStyle(CommonConstants.FONT_SIZE_DESCRIPTION, CommonConstants.FONT_WEIGHT_LIGHT).margin({ bottom: CommonConstants.BOTTOM_TEXT })Text(item.name).textStyle(CommonConstants.FONT_SIZE_TITLE, CommonConstants.FONT_WEIGHT_BOLD)}.alignItems(HorizontalAlign.Start).height(CommonConstants.HEIGHT_CAROUSEL_TITLE).margin({ top: CommonConstants.TOP_ADS, left: CommonConstants.ADS_LEFT })}.height(CommonConstants.FULL_HEIGHT).width(CommonConstants.FULL_WIDTH)}, item => JSON.stringify(item))}.width(CommonConstants.PAGE_WIDTH).height(CommonConstants.HEIGHT_BANNER).index(this.index).indicatorStyle({ selectedColor: $r('app.color.start_window_background') }).indicator(true).duration(CommonConstants.DURATION_ADS)}
}

使用 indicator 屬性設(shè)置是否支持自動輪播

.indicator(true)

設(shè)置自動輪播間隔時間

.duration(CommonConstants.DURATION_ADS)

viewmodel 實現(xiàn)

import { PictureItem } from '../bean/PictureItem';
import { PICTURE_BANNER} from '../constants/PictureConstants';
import { PictureType } from '../constants/PictureConstants';
import { CommonConstants } from '../constants/CommonConstant';/*** Initialize picture data according to type.** @param initType Init type.*/
export function initializePictures(initType: string): Array<PictureItem> {let imageDataArray: Array<PictureItem> = [];switch (initType) {case PictureType.BANNER:PICTURE_BANNER.forEach((item) => {imageDataArray.push(new PictureItem(item.id, item.name, item.description, item.image));})break;default:break;}return imageDataArray;
}let timerIds: number[] = [];/*** start scheduled task.** @param swiperController Controller.*/
export function startPlay(swiperController: SwiperController) {let timerId = setInterval(() => {swiperController.showNext();}, CommonConstants.SWIPER_TIME);timerIds.push(timerId);
}/*** stop scheduled task.*/
export function stopPlay() {timerIds.forEach((item) => {clearTimeout(item);})
}

最后總結(jié):

arkui 寫法和flutter非常的像 有興趣的同學(xué)可以多嘗試哈 今天的文章就講到這里 。最后呢 希望我都文章能幫助到各位同學(xué)工作和學(xué)習

為了能讓大家更好的學(xué)習鴻蒙 (Harmony OS) 開發(fā)技術(shù),這邊特意整理了《鴻蒙 (Harmony OS)開發(fā)學(xué)習手冊》(共計890頁),希望對大家有所幫助:https://qr21.cn/FV7h05

《鴻蒙 (Harmony OS)開發(fā)學(xué)習手冊》

入門必看

  1. 應(yīng)用開發(fā)導(dǎo)讀(ArkTS)
  2. 應(yīng)用開發(fā)導(dǎo)讀(Java)

HarmonyOS 概念:https://qr21.cn/FV7h05

  1. 系統(tǒng)定義
  2. 技術(shù)架構(gòu)
  3. 技術(shù)特性
  4. 系統(tǒng)安全

如何快速入門

  1. 基本概念
  2. 構(gòu)建第一個ArkTS應(yīng)用
  3. 構(gòu)建第一個JS應(yīng)用
  4. ……

開發(fā)基礎(chǔ)知識:https://qr21.cn/FV7h05

  1. 應(yīng)用基礎(chǔ)知識
  2. 配置文件
  3. 應(yīng)用數(shù)據(jù)管理
  4. 應(yīng)用安全管理
  5. 應(yīng)用隱私保護
  6. 三方應(yīng)用調(diào)用管控機制
  7. 資源分類與訪問
  8. 學(xué)習ArkTS語言
  9. ……

基于ArkTS 開發(fā):https://qr21.cn/FV7h05

  1. Ability開發(fā)
  2. UI開發(fā)
  3. 公共事件與通知
  4. 窗口管理
  5. 媒體
  6. 安全
  7. 網(wǎng)絡(luò)與鏈接
  8. 電話服務(wù)
  9. 數(shù)據(jù)管理
  10. 后臺任務(wù)(Background Task)管理
  11. 設(shè)備管理
  12. 設(shè)備使用信息統(tǒng)計
  13. DFX
  14. 國際化開發(fā)
  15. 折疊屏系列
  16. ……

http://m.risenshineclean.com/news/59506.html

相關(guān)文章:

  • 網(wǎng)站建設(shè)技術(shù)服務(wù)公司白度指數(shù)
  • wordpress還原站點設(shè)計網(wǎng)站用什么軟件
  • 深圳做手機網(wǎng)站建設(shè)seo優(yōu)化包括什么
  • 什么店是做網(wǎng)站制作的今天最火的新聞頭條
  • 紹興免費做網(wǎng)站專業(yè)搜索引擎seo服務(wù)
  • 廣告體驗程序網(wǎng)站開發(fā)快速排名方案
  • 建設(shè)網(wǎng)站各方面費用預(yù)算網(wǎng)絡(luò)宣傳
  • 購物網(wǎng)站建設(shè)比較好的知乎關(guān)鍵詞排名優(yōu)化工具
  • 網(wǎng)站后臺怎么修改前臺的某個超鏈接網(wǎng)址常州seo招聘
  • 勝芳網(wǎng)站建設(shè)qiansi湖南靠譜的關(guān)鍵詞優(yōu)化
  • 做網(wǎng)站比特幣錢包淘寶關(guān)鍵詞優(yōu)化推廣排名
  • 嘉興市建設(shè)委員會網(wǎng)站seo實戰(zhàn)視頻
  • 黃浦網(wǎng)站制作seo國外推廣軟件
  • 做照片的網(wǎng)站有哪些seo網(wǎng)站關(guān)鍵詞排名優(yōu)化
  • 國外黑客網(wǎng)站成都多享網(wǎng)站建設(shè)公司
  • 做網(wǎng)站 幫別人賣服務(wù)器地推拉新接單網(wǎng)
  • 開發(fā)網(wǎng)站比較好的公司廈門人才網(wǎng)597人才網(wǎng)
  • 響應(yīng)式網(wǎng)站建設(shè)報價單百度信息流投放在哪些平臺
  • 設(shè)計網(wǎng)站的三個要素揭陽seo推廣公司
  • 尚云網(wǎng)站建設(shè)網(wǎng)絡(luò)運營怎么學(xué)
  • favicon wordpress做seo需要用到什么軟件
  • 怎么做公司網(wǎng)站需要什么科目百度問答官網(wǎng)
  • 網(wǎng)購手表網(wǎng)站查詢網(wǎng)站域名
  • 武漢網(wǎng)絡(luò)推廣公司哪家服務(wù)好長沙seo男團
  • 優(yōu)化網(wǎng)絡(luò)的軟件下載seo百度關(guān)鍵詞優(yōu)化
  • 北京高端網(wǎng)站建設(shè)咸陽今日桂林頭條新聞
  • 陜西網(wǎng)站建設(shè)哪家強企業(yè)模板建站
  • 寫作網(wǎng)站最大看顏色應(yīng)該搜索哪些詞匯
  • c2c電子商務(wù)網(wǎng)站開發(fā)百度熱門關(guān)鍵詞
  • 免費瀏覽器網(wǎng)站品牌營銷推廣公司