鴻蒙應用開發-DevEco Studio 模板體驗(三)
設定頁面框架:
部分程式碼如下:
<DependentLayout xmlns:ohos=" ohos:height="$float:singleCardViewHeight" ohos:width="match_parent"> <Text ohos:id="$+id:item_content_text" ohos:height="$float:singleCardViewTextHeight" ohos:width="match_content" ohos:align_parent_left="true" ohos:center_in_parent="true" ohos:left_margin="$float:singleCardViewLeftMargin" ohos:text_color="$color:textColorPrimary" ohos:text_size="$float:textSizeBody1"/> <Image ohos:id="$+id:item_right_icon" ohos:height="match_content" ohos:width="match_content" ohos:align_parent_right="true" ohos:center_in_parent="true" ohos:image_src="$graphic:icon_right_grey" ohos:right_margin="$float:singleCardViewRightMargin"/> <Text ohos:id="$+id:item_right_content_text" ohos:height="$float:singleCardViewRightTextHeight" ohos:width="match_content" ohos:center_in_parent="true" ohos:left_of="$id:item_right_icon" ohos:right_margin="$float:singleCardViewRightTextRightMargin" ohos:text_color="$color:textColorSecondary" ohos:text_size="$float:textSizeBody2"/> </DependentLayout>
頁面滯留介面跳轉
部分程式碼如下:
<DirectionalLayout xmlns:ohos=" ohos:height="match_content" ohos:width="match_parent" ohos:bottom_margin="$float:margin_common" ohos:left_margin="$float:breadth_common" ohos:orientation="horizontal" ohos:right_margin="$float:breadth_common" ohos:top_margin="$float:margin_common"> <DirectionalLayout ohos:height="match_parent" ohos:width="match_content" ohos:left_padding="$float:breadth_common" ohos:orientation="horizontal" ohos:weight="1"> <Image ohos:id="$+id:item_icon" ohos:height="$float:breadth_checkbox_image" ohos:width="$float:breadth_checkbox_image" ohos:layout_alignment="vertical_center" ohos:left_margin="$float:margin_checkbox_image" ohos:right_margin="$float:breadth_checkbox_image_margin"/> <DirectionalLayout ohos:id="$+id:text_layout" ohos:height="match_content" ohos:width="match_content" ohos:orientation="vertical"> <Text ohos:id="$+id:item_content_text" ohos:height="match_content" ohos:width="match_content" ohos:layout_alignment="left" ohos:text_size="$float:checkbox_main_text_size"/> <Text ohos:id="$+id:item_status_text" ohos:height="match_content" ohos:width="match_content" ohos:layout_alignment="left" ohos:multiple_lines="true" ohos:text_size="$float:checkbox_minor_text_size" ohos:top_margin="$float:margin_between_texts" /> </DirectionalLayout> </DirectionalLayout> <DirectionalLayout xmlns:ohos=" ohos:id="$+id:checkbox_layout" ohos:height="$float:height_checkbox_1" ohos:width="match_content" ohos:bottom_margin="$float:margin_common" ohos:layout_alignment="right" ohos:orientation="horizontal" ohos:right_margin="$float:breadth_checkbox" ohos:top_margin="$float:margin_common"> <Image ohos:id="$+id:item_right_checkbox" ohos:height="$float:height_checkbox_image" ohos:width="$float:width_checkbox_image" ohos:bottom_margin="$float:margin_common2" ohos:image_src="$media:Enabled" ohos:layout_alignment="vertical_center" ohos:top_margin="$float:margin_common2" /> </DirectionalLayout> </DirectionalLayout> </DirectionalLayout>
商品框架:
部分程式碼:
<DirectionalLayout xmlns:ohos=" ohos:height="match_content" ohos:width="match_parent" ohos:bottom_margin="$float:margin_common" ohos:left_margin="$float:breadth_common" ohos:orientation="horizontal" ohos:right_margin="$float:breadth_common" ohos:top_margin="$float:margin_common"> <DirectionalLayout ohos:height="match_parent" ohos:width="match_content" ohos:left_padding="$float:breadth_common" ohos:orientation="horizontal" ohos:weight="1"> <Image ohos:id="$+id:item_icon" ohos:height="$float:breadth_checkbox_image" ohos:width="$float:breadth_checkbox_image" ohos:layout_alignment="vertical_center" ohos:left_margin="$float:margin_checkbox_image" ohos:right_margin="$float:breadth_checkbox_image_margin"/> <DirectionalLayout ohos:id="$+id:text_layout" ohos:height="match_content" ohos:width="match_content" ohos:orientation="vertical"> <Text ohos:id="$+id:item_content_text" ohos:height="match_content" ohos:width="match_content" ohos:layout_alignment="left" ohos:text_size="$float:checkbox_main_text_size"/> <Text ohos:id="$+id:item_status_text" ohos:height="match_content" ohos:width="match_content" ohos:layout_alignment="left" ohos:multiple_lines="true" ohos:text_size="$float:checkbox_minor_text_size" ohos:top_margin="$float:margin_between_texts" /> </DirectionalLayout> </DirectionalLayout> <DirectionalLayout xmlns:ohos=" ohos:id="$+id:checkbox_layout" ohos:height="$float:height_checkbox_1" ohos:width="match_content" ohos:bottom_margin="$float:margin_common" ohos:layout_alignment="right" ohos:orientation="horizontal" ohos:right_margin="$float:breadth_checkbox" ohos:top_margin="$float:margin_common"> <Image ohos:id="$+id:item_right_checkbox" ohos:height="$float:height_checkbox_image" ohos:width="$float:width_checkbox_image" ohos:bottom_margin="$float:margin_common2" ohos:image_src="$media:Enabled" ohos:layout_alignment="vertical_center" ohos:top_margin="$float:margin_common2" /> </DirectionalLayout>
原文連結: https://developer.huawei.com/consumer/cn/forum/topic/0201561270740160431?fid=0101303901040230869
原作者: 蛟龍騰飛
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/69970551/viewspace-2771881/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 鴻蒙應用開發-DevEco Studio 模板體驗(一)鴻蒙dev
- 鴻蒙應用開發-DevEco Studio 模板體驗(四)鴻蒙dev
- DevEco Studio 2.0開發鴻蒙HarmonyOS應用初體驗全面測評dev鴻蒙
- 使用Taro開發鴻蒙原生應用——快速上手,鴻蒙應用開發指南鴻蒙
- 使用 Taro 開發鴻蒙原生應用 —— 快速上手,鴻蒙應用開發指南鴻蒙
- 鴻蒙 HAIWEI DevEco Studio 安裝配置,執行Hello World!鴻蒙AIdev
- 如何使用DevEco Studio建立Native C++應用devC++
- 【鴻蒙千帆起】《開心消消樂》完成鴻蒙原生應用開發,創新多端聯動使用者體驗鴻蒙
- 鴻蒙真的是套殼嗎?HarmonyOS應用開發初體驗,Java原生和JavaScript的mvvm開發鴻蒙JavaScriptMVVM
- 鴻蒙OS 2.0應用開發初潮鴻蒙
- 鴻蒙應用開發新體驗——論大廠產業規劃與就業趨勢鴻蒙產業就業
- 《三國殺》完成鴻蒙原生應用開發,更多遊戲品類加入鴻蒙生態鴻蒙遊戲
- 鴻蒙系統應用基礎開發鴻蒙
- 鴻蒙系統應用開發之開發準備鴻蒙
- .NET MAUI 安卓應用開發初體驗UI安卓
- 自學鴻蒙應用開發(17)- TabList和Tab鴻蒙
- DevEco Studio:Profile Manager功能dev
- 釘釘微應用 開發體驗及心得
- 鴻蒙 Android iOS 應用開發對比02鴻蒙AndroidiOS
- 鴻蒙原生應用開發——分散式資料物件鴻蒙分散式物件
- 快速上手系列--Flutter應用開發模板Flutter
- 用 Android Studio 快捷鍵和活動模板提高開發效率Android
- DevEco Studio 3.1 Release | 動態共享包開發,編譯更快,包更小dev編譯
- 鴻蒙系統應用開發之入門解說鴻蒙
- 加速鴻蒙生態共建,螞蟻mPaaS助力鴻蒙原生應用開發創新鴻蒙
- 【實驗手冊】使用Visual Studio Code 開發.NET Core應用程式
- 快速上手系列--Android應用開發模板Android
- 雷霆遊戲加入鴻蒙“朋友圈”,《問道》手遊啟動鴻蒙原生應用開發遊戲鴻蒙
- 鴻蒙作業系統開發工具DevEco下載和安裝(圖文詳細教程)鴻蒙作業系統dev
- 米哈遊宣佈啟動鴻蒙原生應用開發鴻蒙
- 相容性自動化測試 | HUAWEI DevEco Studio雲測服務等您來體驗dev
- 搭建Typescript+React專案模板(2) --- 提升開發體驗TypeScriptReact
- 鴻蒙系統應用開發之基於API6的藍芽開發鴻蒙API藍芽
- 來BSN,體驗更輕鬆的公鏈應用開發
- 軟通動力鴻蒙書籍《HarmonyOS應用開發》正式出版鴻蒙
- 使用 SAP Business Application Studio 開發 Vue 應用APPVue
- 快應用之開發體驗紀要
- DevEco Studio使用指南--平行視界dev