本文只针对android对比介绍
鸿蒙 | 安卓 |
vp | dp |
fp | sp |
一、DirectionalLayout 布局 官方文档
android : LinearLayout
部分属性差异介绍
鸿蒙 | 安卓 |
match_ontent | wrap_content |
background_element | background |
alignment | gravity |
total_weight | layout_weight |
子视图属性差异
鸿蒙 | 安卓 |
layout_alignment | layout_gravity |
weight | layout_weight |
二、DependentLayout布局 官方文档
android : RelativeLayout
部分属性差异介绍
鸿蒙 | 安卓 |
left_of 等等 | layout_toLeftOf 等等 |
above | layout_above |
below | layout_below |
align_left 等等 | layout_alignLeft 等等 |
align_parent_left 等等 | layout_alignParentLeft 等等 |
center_in_parent | layout_centerInParent |
horizontal_center | layout_centerHorizontal |
vertical_center | layout_centerVertical |