【鸿蒙应用开发高手之路】07_自适应布局之隐藏能力
所谓隐藏能力,指的是:当父容器的尺寸发生变化时,子组件按照其预设的显示优先级随之显示或隐藏。
@Entry@Componentstruct Hide { build() { Row() { Image($r("app.media.collection")) .width(180) .height(180) .displayPriority(1) Image($r("app.media.last")) .width(180) .height(180) .displayPriority(2) Image($r("app.media.pause")) .width(180) .height(180) .displayPriority(3) Image($r("app.media.next")) .width(180) .height(180) .displayPriority(2) Image($r("app.media.list")) .width(180) .height(180) .displayPriority(1) } .width('100%') .justifyContent(FlexAlign.Center) }}