@@ -7,13 +7,12 @@ import { LinearGradient } from '../styling/linear-gradient';
7
7
import { colorProperty , backgroundInternalProperty , backgroundColorProperty , backgroundImageProperty } from '../styling/style-properties' ;
8
8
import { ios as iosViewUtils } from '../utils' ;
9
9
import { ImageSource } from '../../image-source' ;
10
- import { layout , iOSNativeHelper , isFontIconURI } from '../../utils' ;
10
+ import { layout , isFontIconURI } from '../../utils' ;
11
11
import { SDK_VERSION } from '../../utils/constants' ;
12
12
import { accessibilityHintProperty , accessibilityLabelProperty , accessibilityLanguageProperty , accessibilityValueProperty } from '../../accessibility/accessibility-properties' ;
13
13
14
14
export * from './action-bar-common' ;
15
15
16
- const majorVersion = iOSNativeHelper . MajorVersion ;
17
16
const UNSPECIFIED = layout . makeMeasureSpec ( 0 , layout . UNSPECIFIED ) ;
18
17
19
18
interface NSUINavigationBar extends UINavigationBar {
@@ -271,7 +270,7 @@ export class ActionBar extends ActionBarBase {
271
270
// show the one from the old page but the new page will still be visible (because we canceled EdgeBackSwipe gesutre)
272
271
// Consider moving this to new method and call it from - navigationControllerDidShowViewControllerAnimated.
273
272
const image = img ? img . imageWithRenderingMode ( UIImageRenderingMode . AlwaysOriginal ) : null ;
274
- if ( majorVersion >= 15 ) {
273
+ if ( SDK_VERSION >= 15 ) {
275
274
const appearance = this . _getAppearance ( navigationBar ) ;
276
275
appearance . setBackIndicatorImageTransitionMaskImage ( image , image ) ;
277
276
this . _updateAppearance ( navigationBar , appearance ) ;
@@ -304,6 +303,9 @@ export class ActionBar extends ActionBarBase {
304
303
navigationItem . accessibilityLabel = this . accessibilityLabel ;
305
304
navigationItem . accessibilityLanguage = this . accessibilityLanguage ;
306
305
navigationItem . accessibilityHint = this . accessibilityHint ;
306
+
307
+ // Configure large title support for this navigation item
308
+ this . checkLargeTitleSupport ( navigationItem ) ;
307
309
}
308
310
309
311
private populateMenuItems ( navigationItem : UINavigationItem ) {
@@ -378,7 +380,7 @@ export class ActionBar extends ActionBarBase {
378
380
}
379
381
if ( color ) {
380
382
const titleTextColor = NSDictionary . dictionaryWithObjectForKey ( color . ios , NSForegroundColorAttributeName ) ;
381
- if ( majorVersion >= 15 ) {
383
+ if ( SDK_VERSION >= 15 ) {
382
384
const appearance = this . _getAppearance ( navBar ) ;
383
385
appearance . titleTextAttributes = titleTextColor ;
384
386
}
@@ -398,7 +400,7 @@ export class ActionBar extends ActionBarBase {
398
400
}
399
401
400
402
const nativeColor = color instanceof Color ? color . ios : color ;
401
- if ( __VISIONOS__ || majorVersion >= 15 ) {
403
+ if ( __VISIONOS__ || SDK_VERSION >= 15 ) {
402
404
const appearance = this . _getAppearance ( navBar ) ;
403
405
// appearance.configureWithOpaqueBackground();
404
406
appearance . backgroundColor = nativeColor ;
@@ -416,7 +418,7 @@ export class ActionBar extends ActionBarBase {
416
418
417
419
let color : UIColor ;
418
420
419
- if ( __VISIONOS__ || majorVersion >= 15 ) {
421
+ if ( __VISIONOS__ || SDK_VERSION >= 15 ) {
420
422
const appearance = this . _getAppearance ( navBar ) ;
421
423
color = appearance . backgroundColor ;
422
424
} else {
@@ -432,7 +434,7 @@ export class ActionBar extends ActionBarBase {
432
434
return ;
433
435
}
434
436
435
- if ( __VISIONOS__ || majorVersion >= 15 ) {
437
+ if ( __VISIONOS__ || SDK_VERSION >= 15 ) {
436
438
const appearance = this . _getAppearance ( navBar ) ;
437
439
// appearance.configureWithOpaqueBackground();
438
440
appearance . backgroundImage = image ;
@@ -456,7 +458,7 @@ export class ActionBar extends ActionBarBase {
456
458
457
459
let image : UIImage ;
458
460
459
- if ( __VISIONOS__ || majorVersion >= 15 ) {
461
+ if ( __VISIONOS__ || SDK_VERSION >= 15 ) {
460
462
const appearance = this . _getAppearance ( navBar ) ;
461
463
image = appearance . backgroundImage ;
462
464
} else {
@@ -507,6 +509,8 @@ export class ActionBar extends ActionBarBase {
507
509
return ;
508
510
}
509
511
512
+ console . log ( 'ActionBar._onTitlePropertyChanged' , this . title ) ;
513
+
510
514
if ( page . frame ) {
511
515
page . frame . _updateActionBar ( page ) ;
512
516
}
@@ -517,7 +521,7 @@ export class ActionBar extends ActionBarBase {
517
521
518
522
private updateFlatness ( navBar : UINavigationBar ) {
519
523
if ( this . flat ) {
520
- if ( majorVersion >= 15 ) {
524
+ if ( SDK_VERSION >= 15 ) {
521
525
const appearance = this . _getAppearance ( navBar ) ;
522
526
appearance . shadowColor = UIColor . clearColor ;
523
527
this . _updateAppearance ( navBar , appearance ) ;
@@ -530,7 +534,7 @@ export class ActionBar extends ActionBarBase {
530
534
navBar . translucent = false ;
531
535
}
532
536
} else {
533
- if ( majorVersion >= 15 ) {
537
+ if ( SDK_VERSION >= 15 ) {
534
538
if ( navBar . standardAppearance ) {
535
539
// Not flat and never been set do nothing.
536
540
const appearance = navBar . standardAppearance ;
@@ -581,7 +585,7 @@ export class ActionBar extends ActionBarBase {
581
585
public onLayout ( left : number , top : number , right : number , bottom : number ) {
582
586
const titleView = this . titleView ;
583
587
if ( titleView ) {
584
- if ( majorVersion > 10 ) {
588
+ if ( SDK_VERSION > 10 ) {
585
589
// On iOS 11 titleView is wrapped in another view that is centered with constraints.
586
590
View . layoutChild ( this , titleView , 0 , 0 , titleView . getMeasuredWidth ( ) , titleView . getMeasuredHeight ( ) ) ;
587
591
} else {
@@ -670,4 +674,26 @@ export class ActionBar extends ActionBarBase {
670
674
this . navBar . prefersLargeTitles = value ;
671
675
}
672
676
}
677
+
678
+ private checkLargeTitleSupport ( navigationItem : UINavigationItem ) {
679
+ const navBar = this . navBar ;
680
+ if ( ! navBar ) {
681
+ return ;
682
+ }
683
+ // Configure large title display mode only when not using a custom titleView
684
+ if ( SDK_VERSION >= 11 ) {
685
+ if ( this . iosLargeTitle ) {
686
+ // Always show large title for this navigation item when large titles are enabled
687
+ navigationItem . largeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode . Always ;
688
+ } else {
689
+ if ( SDK_VERSION >= 26 ) {
690
+ // Explicitly disable large titles for this navigation item
691
+ // Due to overlapping title issue in iOS 26
692
+ navigationItem . largeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode . Never ;
693
+ } else {
694
+ navigationItem . largeTitleDisplayMode = UINavigationItemLargeTitleDisplayMode . Automatic ;
695
+ }
696
+ }
697
+ }
698
+ }
673
699
}
0 commit comments