参考示例如下:// xxx.ets @Entry @Component struct Index { build() { Stack() { Scroll() { Stack({ alignContent: Alignment.TopStart }) { Column() { Text() .width('100%') .height(1000) .backgroundColor(Color.Brown) } .width('100%') .height(1000) .translate({ y: -1000 }) .zIndex(1) .hitTestBehavior(HitTestMode.None) Column({ space: 12 }) { Column() { Image($r('app.media.startIcon')) .width('100%') .aspectRatio(1080 / 496) .objectFit(ImageFit.Fill)// TODO why cover not work .onClick(() => { console.log('pqz') }) } Column() .width('100%') .height(1000) .backgroundColor(Color.Red) } .zIndex(2) } } .width('100%') .height('100%') .scrollBar(BarState.Off) .align(Alignment.Top) .edgeEffect(EdgeEffect.Spring) .backgroundColor(Color.Transparent) } } }
参考示例如下: