如何自定义Navigation titlebar?(HarmonyOS 鸿蒙Next)
如何自定义Navigation titlebar?(HarmonyOS 鸿蒙Next) 如何自定义Navigation titlebar?
3 回复
@Entry @Component struct TextPage1 { @State message: string = ‘Hello World’;
@Builder navTitle() { Row(){ //在这里可以添加自己的页面 Text(‘title’) .fontColor(Color.White) } .width(‘100%’) .height(‘100%’) .backgroundColor(Color.Red) }
build() { Navigation(){
}
.title(this.navTitle())
.titleMode(NavigationTitleMode.Mini) //设置导航栏模式
.hideBackButton(true) //隐藏返回按钮
} }
更多关于如何自定义Navigation titlebar?(HarmonyOS 鸿蒙Next)的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
- @Builder
- NavigationTitle() {
- Column() {
- Text(‘Title’)
- }
- }
- Navigation() {
- }
- .title(this.NavigationTitle)