harmony 鸿蒙ArkUI Subsystem Changelog

  • 2023-06-24
  • 浏览 (291)

ArkUI Subsystem Changelog

Fixed the issue where the layout of child components in the <Stack> container does not follow the alignContent settings when the child components do not fit in the container.

Example:

@Entry
@Component
struct StackExample {
  build() {
    Stack({alignContent:Alignment.TopEnd}){
      Text('First child, show in bottom')
        .width(200).height(200).backgroundColor(0xd2cab3).margin(10)
    }.width(150).height(150).backgroundColor(Color.Pink).margin(100)
  }
}

Before: Child components are not arranged based on alignContent:Alignment.TopEnd.

stack

After: Child components are arranged based on alignContent:Alignment.TopEnd.

stack

Change Impact

The previous workaround – setting the Offset or translate attribute – needs to be removed.

Adaptation Guide

Remove the Offset and translate settings for the child components and use alignContent for layout.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙1.0.0 (2022/03/09)

harmony 鸿蒙OpenHarmony Docker镜像

harmony 鸿蒙OpenHarmony Docker Image

harmony 鸿蒙Legal Notices

harmony 鸿蒙OpenHarmony Project

harmony 鸿蒙IDL Specifications and User Guide (for System Applications Only)

harmony 鸿蒙Application Development

harmony 鸿蒙OAID Service

harmony 鸿蒙AI

0  赞