ion-tabs & ion-content overlaps ion-header -on android
Short description of the problem:
ion-tabs & ion-content overlaps the ion-header, in Android when loading an image in the header.
Steps to reproduce:
- put an image on the header.
- set src property in the ngOnInit() function
- First time loading the page. (when i navigate to other page and then i try again it loads ok.)
this is the html
<ion-header class="header">
<ion-navbar class="titulo" color="primary">
<button ion-button menuToggle>
<ion-icon name='menu'></ion-icon>
</button>
<ion-title>{{"menu.servicios" | translate}}</ion-title>
</ion-navbar>
<img class="cabecera" [src]="image">
</ion-header>
<ion-content padding class="has-header">
<ion-list class="my-animation" *ngFor="let servicio of $servicios | async; let i = index">
<ion-item>
<ion-avatar item-left>
<img src="assets/img/{{servicio.imagen}}" >
</ion-avatar>
<h2>{{servicio.nombre | translate}}</h2>
<p>{{servicio.descripcion | translate}} </p>
</ion-item>
</ion-list>
</ion-content>
this is the onInit
ngOnInit(){
if (Network.connection != 'none'){
this.gallery = "https://source.unsplash.com/640x300/?technology"
}
Ionic Version 2.x
Plunker that shows an example of your issue
http://plnkr.co/edit/CpBXmn?p=preview
Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Mac OS X El Capitan
Node Version: v6.8.0
Xcode version: Xcode 7.1.1 Build version 7B1005
The problem seems to be that the ion-tabs & ion-content are created before the image loads and header doesn't have the real height yet.
A posible solution is "Thanks to Niel de Wet" to resizing the ion-content after the image loads as described in this issue.
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Thank you for using Ionic!