Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
张善主
2024-06-04 16:44:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e8e4abfe4e298b81b6ddcde54f9836fba5c4b389
e8e4abfe
1 parent
9e499d42
fix(多图):顶部底部适配
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
29 deletions
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
sight_harmony/features/wdComponent/src/main/ets/pages/MultiPictureListPage.ets
View file @
e8e4abf
...
...
@@ -3,7 +3,6 @@ import { display, router } from '@kit.ArkUI';
import { ImageItemView } from '../components/view/ImageItemView';
import { ImageDownloadComponent } from '../components/ImageDownloadComponent';
import { Action } from 'wdBean';
import { WindowModel } from 'wdKit/Index';
const TAG = 'MultiPictureListPage';
...
...
@@ -20,11 +19,11 @@ export struct MultiPictureListPage {
@State picHeight: number = 0
@State isEnableSwipe: boolean = true;
@State currentUrl: string = ''
@Provide bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@Provide topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
// @Provide bgc: Color = Color.White;
aboutToAppear(): void {
this.openFullScreen()
//获取宽高尺寸
this.screenWidth = this.displayTool.width
// this.picWidth = this.screenWidth - vp2px(52)
...
...
@@ -57,7 +56,6 @@ export struct MultiPictureListPage {
if (this.photoList && this.photoList?.length > 0) {
Swiper(this.swiperController) {
ForEach(this.photoList, (item: PhotoListBean) => {
// MultiPictureDetailItemComponent({ MultiPictureDetailItem: item })
ImageItemView({ MultiPictureDetailItem: item, isEnableSwipe: this.isEnableSwipe })
})
}
...
...
@@ -135,37 +133,16 @@ export struct MultiPictureListPage {
}
.width('100%')
.height('100%')
// .padding({top:$r('app.float.margin_44')
})
.padding({top: `${this.topSafeHeight}px`,bottom:`${this.bottomSafeHeight}px`
})
.backgroundColor(Color.Black)
.id('e_picture_container')
// 设置顶部绘制延伸到状态栏
// 设置底部绘制延伸到导航条
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
/**
* 开启沉浸式
* TODO:颜色待根据业务接口修改
*/
openFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
// WindowModel.shared.setWindowLayoutFullScreen(true)
// WindowModel.shared.setWindowSystemBarEnable([])
// .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP, SafeAreaEdge.BOTTOM])
}
aboutToDisappear(): void {
console.log(TAG, 'aboutToDisappear')
this.closeFullScreen()
}
/**
* 关闭沉浸式
* TODO:颜色待根据业务接口修改
*/
closeFullScreen() {
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
// WindowModel.shared.setWindowLayoutFullScreen(false)
// WindowModel.shared.setWindowSystemBarEnable(['status', 'navigation'])
}
onBackPress(): boolean | void {
...
...
@@ -173,7 +150,5 @@ export struct MultiPictureListPage {
}
private onBack() {
// 提前设置,否则返回的页面展示有问题(有时延)
this.closeFullScreen()
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment