Skip to content

bug: Long dynamic header titles are cutoff #4661

Description

@DavidFrahm

Type: bug

Platform: ios 7 webview

In multiple Ionic apps where I need to set the view title dynamically, I use this markup:

<ion-view>
    <ion-nav-title ng-bind="category.name"></ion-nav-title>
    <ion-content>
    ...snip...

That works great until it encounters a view title that too long to fit in the bar (easier to test on smaller devices like iPhone 4/5). With a long value, it displays just like one character and the ellipsis.

I fix it by adding this to my scss:

// Longer ion header titles intermittently have crazy large right values on iOS
.platform-ios,
.platform-browser {
  .title.title-center.header-item {
    right: 26px !important;
  }
}

This seems like it might just be an issue with the Angular lifecycle of things, and might not be a clean fix on the Ionic side. (Similar to the issue of why view-title="{{category.name}}" has issues.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions