1e41f4b71Sopenharmony_ci# ArkUI Subsystem Changelog
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci## cl.arkui.1 Change in the Custom Navigation Title Position
4e41f4b71Sopenharmony_ci
5e41f4b71Sopenharmony_ci1. **NavigationTitleMode** is set to **Full**, **Free**, or **Mini** without the back button.
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci   API version 9: The left margin remains at 24 vp.
8e41f4b71Sopenharmony_ci
9e41f4b71Sopenharmony_ci   API version 10: The left margin is changed from 24 vp to 0. The top margin is changed from center to 0.
10e41f4b71Sopenharmony_ci
11e41f4b71Sopenharmony_ci2. **NavigationTitleMode** is set to **Mini** and the back button is displayed.
12e41f4b71Sopenharmony_ci
13e41f4b71Sopenharmony_ci   API version 9: The spacing between the custom title and the back button is 16 vp.
14e41f4b71Sopenharmony_ci
15e41f4b71Sopenharmony_ci   API version 10: The spacing between the custom title bar and the back button is changed from 16 vp to 12 vp.
16e41f4b71Sopenharmony_ci
17e41f4b71Sopenharmony_ci3. A custom menu is configured.
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci   API version 9: The right margin is 24 vp.
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci   API version 10: The right margin is changed from 24 vp to 0.
22e41f4b71Sopenharmony_ci
23e41f4b71Sopenharmony_ci**Reason for Change**
24e41f4b71Sopenharmony_ci
25e41f4b71Sopenharmony_ciSince API version 9, offsets are added the custom title and menu of the **\<Navigation>** component, which affects the use of custom components. Since OpenHarmony 4.0.10.6, the offsets are removed from applications in API version 10.
26e41f4b71Sopenharmony_ci
27e41f4b71Sopenharmony_ci**Change Impact**
28e41f4b71Sopenharmony_ci
29e41f4b71Sopenharmony_ciIn API version 10, the custom navigation title is displayed on the left of or above the position where it would appear in previous API versions.
30e41f4b71Sopenharmony_ci
31e41f4b71Sopenharmony_ci**Adaptation Guide**
32e41f4b71Sopenharmony_ci
33e41f4b71Sopenharmony_ci1. For **NavigationTitleMode.Full**, **NavigationTitleMode.Free**, and **NavigationTitleMode.Mini**, you can add a left margin by using **$r('sys.float.ohos_id_max_padding_start')**. To center the title on the top, use **.height('100%').alignItems(VerticalAlign.Center)**.
34e41f4b71Sopenharmony_ci
35e41f4b71Sopenharmony_ci2. For **NavigationTitleMode.Mini** with the back button displayed, you can add a left margin by using **.margin({left: 4})**. To center the title on the top, use **.height('100%').alignItems(VerticalAlign.Center)**.
36e41f4b71Sopenharmony_ci
37e41f4b71Sopenharmony_ci3. When a custom menu is configured, you can add a right margin by using **.margin({right: $r('sys.float.ohos_id_max_padding_end')})**.
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci
40e41f4b71Sopenharmony_ci**Example**
41e41f4b71Sopenharmony_ci```ts
42e41f4b71Sopenharmony_ci@Entry
43e41f4b71Sopenharmony_ci@Component
44e41f4b71Sopenharmony_cistruct Index {
45e41f4b71Sopenharmony_ci  @State titleMode: NavigationTitleMode = NavigationTitleMode.Free
46e41f4b71Sopenharmony_ci  @State backButton: boolean = false;
47e41f4b71Sopenharmony_ci  @Builder CustomMenu() {
48e41f4b71Sopenharmony_ci    Column() {
49e41f4b71Sopenharmony_ci      Image($r('app.media.icon')).width(24).height(24)
50e41f4b71Sopenharmony_ci    }
51e41f4b71Sopenharmony_ci  }
52e41f4b71Sopenharmony_ci
53e41f4b71Sopenharmony_ci  @Builder CustomTitle() {
54e41f4b71Sopenharmony_ci    Column() {
55e41f4b71Sopenharmony_ci      Text('Custom title').fontSize(20)
56e41f4b71Sopenharmony_ci    }
57e41f4b71Sopenharmony_ci  }
58e41f4b71Sopenharmony_ci
59e41f4b71Sopenharmony_ci  build() {
60e41f4b71Sopenharmony_ci    Column() {
61e41f4b71Sopenharmony_ci      Navigation() {
62e41f4b71Sopenharmony_ci        Column() {
63e41f4b71Sopenharmony_ci          Text(`Change current title mode: ${this.titleMode}`)
64e41f4b71Sopenharmony_ci            .onClick(()=>{
65e41f4b71Sopenharmony_ci              if (this.titleMode == NavigationTitleMode.Free) {
66e41f4b71Sopenharmony_ci                this.titleMode = NavigationTitleMode.Full;
67e41f4b71Sopenharmony_ci              } else if (this.titleMode == NavigationTitleMode.Full) {
68e41f4b71Sopenharmony_ci                this.titleMode = NavigationTitleMode.Mini;
69e41f4b71Sopenharmony_ci              } else {
70e41f4b71Sopenharmony_ci                this.titleMode = NavigationTitleMode.Free;
71e41f4b71Sopenharmony_ci              }
72e41f4b71Sopenharmony_ci            })
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci          Text(`Change back button: ${this.backButton}`).onClick(()=>{
75e41f4b71Sopenharmony_ci            this.backButton = !this.backButton;
76e41f4b71Sopenharmony_ci          }).margin({top: 10})
77e41f4b71Sopenharmony_ci        }.margin({top: 40})
78e41f4b71Sopenharmony_ci      }.title(this.CustomTitle)
79e41f4b71Sopenharmony_ci      .titleMode(this.titleMode)
80e41f4b71Sopenharmony_ci      .menus(this.CustomMenu)
81e41f4b71Sopenharmony_ci      .hideBackButton(this.backButton)
82e41f4b71Sopenharmony_ci    }
83e41f4b71Sopenharmony_ci  }
84e41f4b71Sopenharmony_ci}
85e41f4b71Sopenharmony_ci```
86e41f4b71Sopenharmony_ciAPI version 9: Custom title and menu in **NavigationTitleMode.Full** settings
87e41f4b71Sopenharmony_ci
88e41f4b71Sopenharmony_ci![Navigation](figures/navigation_full_title_sdk9.png)
89e41f4b71Sopenharmony_ci
90e41f4b71Sopenharmony_ciAPI version 10: Custom title and menu in **NavigationTitleMode.Full** settings
91e41f4b71Sopenharmony_ci
92e41f4b71Sopenharmony_ci![Navigation](figures/navigation_full_title_sdk10.png)
93e41f4b71Sopenharmony_ci
94e41f4b71Sopenharmony_ciAPI version 9: Custom title with the back button in **NavigationTitleMode.Mini** settings
95e41f4b71Sopenharmony_ci
96e41f4b71Sopenharmony_ci![Navigation](figures/navigation_mini_title_sdk9.png)
97e41f4b71Sopenharmony_ci
98e41f4b71Sopenharmony_ciAPI version 10: Custom title with the back button in **NavigationTitleMode.Mini** settings
99e41f4b71Sopenharmony_ci
100e41f4b71Sopenharmony_ci![Navigation](figures/navigation_mini_title_sdk10.png)
101e41f4b71Sopenharmony_ci
102e41f4b71Sopenharmony_ciAPI version 9: Custom title without the back button in **NavigationTitleMode.Mini** settings
103e41f4b71Sopenharmony_ci
104e41f4b71Sopenharmony_ci![Navigation](figures/navigation_mini_title_no_back_sdk9.png)
105e41f4b71Sopenharmony_ci
106e41f4b71Sopenharmony_ciAPI version 10: Custom title without the back button in **NavigationTitleMode.Mini** settings
107e41f4b71Sopenharmony_ci
108e41f4b71Sopenharmony_ci![Navigation](figures/navigation_mini_title_no_back_sdk10.png)
109e41f4b71Sopenharmony_ci
110e41f4b71Sopenharmony_ci## cl.arkui.2 Title Bar Change of the \<NavDestination> Component
111e41f4b71Sopenharmony_ci
112e41f4b71Sopenharmony_ciFor custom titles:
113e41f4b71Sopenharmony_ci
114e41f4b71Sopenharmony_ci1. With the back button
115e41f4b71Sopenharmony_ci
116e41f4b71Sopenharmony_ci   API version 9: The spacing between the back button and the title bar is 16 vp, and the title bar is centered.
117e41f4b71Sopenharmony_ci
118e41f4b71Sopenharmony_ci   API version 10: The spacing between the back button and the title bar is changed from 16 vp to 12 vp, and the top offset of the title bar is changed to 0.
119e41f4b71Sopenharmony_ci
120e41f4b71Sopenharmony_ci2. Without the back button
121e41f4b71Sopenharmony_ci
122e41f4b71Sopenharmony_ci   API version 9: The title bar is centered, with a left margin of 24 vp.
123e41f4b71Sopenharmony_ci
124e41f4b71Sopenharmony_ci   API version 10: The left margin of the title bar is changed from 24 vp to 0, and its top offset is changed to 0.
125e41f4b71Sopenharmony_ci
126e41f4b71Sopenharmony_ci**Reason for Change**
127e41f4b71Sopenharmony_ci
128e41f4b71Sopenharmony_ciSince API version 9, offsets are added to the custom title of the **\<Navigation>** component, which affects the use of custom components. Since OpenHarmony 4.0.10.6, the offsets are removed from applications in API version 10.
129e41f4b71Sopenharmony_ci
130e41f4b71Sopenharmony_ci**Change Impact**
131e41f4b71Sopenharmony_ciThe custom title bar of the **\<NavDestination>** component is displayed in the upper left corner of the position where it would appear in previous API versions.
132e41f4b71Sopenharmony_ci
133e41f4b71Sopenharmony_ci**Adaptation Guide**
134e41f4b71Sopenharmony_ci
135e41f4b71Sopenharmony_ciTo retain the display effect in previous versions, you can use the following solution:
136e41f4b71Sopenharmony_ci
137e41f4b71Sopenharmony_ci1. Where the back button is not displayed: Add a left offset by using **margin({left: $r('sys.float.ohos_id_max_padding_start')})**. To center the title bar on the top, use **.height ('100%').alignItems (VerticalAlign.Center)**.
138e41f4b71Sopenharmony_ci
139e41f4b71Sopenharmony_ci2. Where the back button is displayed: Add a left offset by using **margin ({left: 4})**. To center the title bar on the top, use **.height ('100%').alignItems (VerticalAlign.Center)**.
140e41f4b71Sopenharmony_ci
141e41f4b71Sopenharmony_ci**Example**
142e41f4b71Sopenharmony_ci```ts
143e41f4b71Sopenharmony_ci@Entry
144e41f4b71Sopenharmony_ci@Component
145e41f4b71Sopenharmony_cistruct Index {
146e41f4b71Sopenharmony_ci  @Builder NavigationTile() {
147e41f4b71Sopenharmony_ci    Column() {
148e41f4b71Sopenharmony_ci      Text('title').fontColor('#182431').fontSize(30).lineHeight(41)
149e41f4b71Sopenharmony_ci      Text('subTitle').fontColor('#182431').fontSize(14).lineHeight(19).margin(top:2, bottom: 20)
150e41f4b71Sopenharmony_ci    }
151e41f4b71Sopenharmony_ci  }
152e41f4b71Sopenharmony_ci
153e41f4b71Sopenharmony_ci  build() {
154e41f4b71Sopenharmony_ci    Column() {
155e41f4b71Sopenharmony_ci      Navigation() {
156e41f4b71Sopenharmony_ci        Text('Navigation')
157e41f4b71Sopenharmony_ci      }.title(this.NavigationTitle)
158e41f4b71Sopenharmony_ci       .titleMode(NavigationTitleMode.Free)
159e41f4b71Sopenharmony_ci       .menus([
160e41f4b71Sopenharmony_ci        {icon: 'common/image/icon.png', value: 'menu1'}
161e41f4b71Sopenharmony_ci       ])
162e41f4b71Sopenharmony_ci    }
163e41f4b71Sopenharmony_ci  }
164e41f4b71Sopenharmony_ci}
165e41f4b71Sopenharmony_ci```
166e41f4b71Sopenharmony_ci
167e41f4b71Sopenharmony_ciAPI version 9: Custom title bar with the back button
168e41f4b71Sopenharmony_ci
169e41f4b71Sopenharmony_ci![NavDstination](figures/navdestination_back_sdk9.png)
170e41f4b71Sopenharmony_ci
171e41f4b71Sopenharmony_ciAPI version 10: Custom title bar with the back button
172e41f4b71Sopenharmony_ci
173e41f4b71Sopenharmony_ci![NavDestination](figures/navdestination_back_sdk10.png)
174e41f4b71Sopenharmony_ci
175e41f4b71Sopenharmony_ciAPI version 9: Custom title bar without the back button
176e41f4b71Sopenharmony_ci
177e41f4b71Sopenharmony_ci![NavDestination](figures/navdestination_no_back_sdk9.png)
178e41f4b71Sopenharmony_ci
179e41f4b71Sopenharmony_ciAPI version 10: Custom title bar without the back button
180e41f4b71Sopenharmony_ci
181e41f4b71Sopenharmony_ci![NavDestination](figures/navdestination_no_back_sdk10.png)
182e41f4b71Sopenharmony_ci
183e41f4b71Sopenharmony_ci## cl.arkui.3 OnStateChange Callback Change of the \<NavRouter> Component
184e41f4b71Sopenharmony_ci
185e41f4b71Sopenharmony_ciChanged the number of **OnStateChange** calls for displaying the **\<NavDestination>** component from 2 to 1, which does not affect the call sequence.
186e41f4b71Sopenharmony_ci
187e41f4b71Sopenharmony_ci**Change Impact**
188e41f4b71Sopenharmony_ci
189e41f4b71Sopenharmony_ciApplications that use **OnStateChange** for call timing are affected.
190e41f4b71Sopenharmony_ci
191e41f4b71Sopenharmony_ci- Call sequence before the change: **OnStateChange(true)** triggered by display of **\<NavRouter>** -> **OnStateChange(false)** triggered by exiting of **\<NavRouter>** -> **OnStateChange(true)** triggered by display of **\<NavRouter>**
192e41f4b71Sopenharmony_ci
193e41f4b71Sopenharmony_ci- Call sequence after the change: **OnStateChange(true)** triggered by display of **\<NavRouter>** -> **OnStateChange(false)** triggered by exiting of **\<NavRouter>**