Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ionic v4] ion-header ion-toolbar height to big on Android devices #15116

Closed
peterpeterparker opened this issue Aug 10, 2018 · 13 comments
Closed
Assignees

Comments

@peterpeterparker
Copy link
Contributor

Ionic Info
@ionic/angular: "4.0.0-beta.2"

Describe the Bug
The ion-header ion-toolbar height is too big on (real) Android devices (see Screenshot)

Expected Behavior
A correct header size on devices

Related
In beta.2 the same issue was solved for iOS, don't know if it's related #15073

Screenshot
screenshot_20180810-101102

@ionitron-bot ionitron-bot bot added the triage label Aug 10, 2018
@MarJaysonSanAgustin
Copy link

MarJaysonSanAgustin commented Aug 11, 2018

I solved the issue using these steps:

  1. On MainActivity.java file on Android platform folderplatforms/android/src/../../MainActivity.java, paste the following code after super.onCreate()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
	getWindow().getDecorView().setSystemUiVisibility(
	   View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN |
	   View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
}
  1. Add these packages in MainActivity.java
import android.os.Build;
import android.view.View;

Reference: https://github.com/jeneser/ionic-super-bar

@peterpeterparker
Copy link
Contributor Author

@JAYiSON021 I don't think that's related. With the same platform version I don't face the problem with v3 only with v4

@MarJaysonSanAgustin
Copy link

@peterpeterparker I tried that in my newly generated project (v4) because i had the same problem on native device.

@peterpeterparker
Copy link
Contributor Author

@JAYiSON021 in that case that's a workaround, thx ;) Out of the box I think that the height of the header of a Ionic app should match the device without any modification in the platform code therefore I think it need a fix

@ionitron-bot ionitron-bot bot removed the triage label Aug 11, 2018
@bleuscyther
Copy link

what happens if you do :
this.statusBar.overlaysWebView(false);

or

this.statusBar.overlaysWebView(true);

also check the config.xml to see if its enabled/disabled

@peterpeterparker
Copy link
Contributor Author

@bleuscyther I migrate my app from v3 to v4, the statusbar settings are exactly the same

@bleuscyther
Copy link

i just noticed that the page looking at for a reference has no header.
Same issue reported here: #15138

@brandyscarney
Copy link
Member

@peterpeterparker Are you still seeing this on beta.3?

@peterpeterparker
Copy link
Contributor Author

@brandyscarney thx for asking. yes the issue is still here with beta.3

screenshot of my paired device

capture d ecran 2018-08-17 a 07 11 55

screenshot from the device

screenshot_20180817-071103

@brandyscarney
Copy link
Member

@manucorporat I think we need to check for the platform class for this: https://github.com/ionic-team/ionic/blob/master/core/src/components/app/app.scss#L6

@abou-emish
Copy link

@brandyscarney you are right, the following CSS fixed it

ion-header.header-md ion-toolbar:first-child {
    padding-top: 0;
}

@manucorporat manucorporat self-assigned this Aug 25, 2018
@peterpeterparker
Copy link
Contributor Author

I could confirm that, with v4-beta.5, the height of my toolbar/header is now correct on both real iPhone 6s and Android Samsung Edge and simulated iPhone X

Thx a lot!

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 28, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. 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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants