Coder Social home page Coder Social logo

Comments (11)

trytuna avatar trytuna commented on August 25, 2024 2

For those of you who want to get it to work for iPhone X.

First install the latest statusbar plugin (only necessary before version [email protected]).

ionic cordova plugin rm cordova-plugin-statusbar
ionic cordova plugin add https://github.com/apache/cordova-plugin-statusbar

Use this CSS instead of @danielehrhardt's

// Ionic Super Tabs iOS + iPhone X Fix
.ios .ion-page,
.ios .modal-wrapper > .ion-page {
    ion-header.header-ios > ion-navbar.toolbar-ios.statusbar-padding {
        padding-top: calc(4px + 20px);
        padding-top: calc(4px + env(safe-area-inset-top));
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        min-height: calc(44px + 20px);
        min-height: calc(44px + env(safe-area-inset-top));
    
        ion-title {
            padding-top: calc(4px + 20px);
            padding-top: calc(4px + env(safe-area-inset-top));
            height: calc(44px + 20px);
            height: calc(44px + env(safe-area-inset-top));
            min-height: calc(44px + 20px);
            min-height: calc(44px + env(safe-area-inset-top));
        }
    }

    super-tabs.tabs-placement-bottom super-tabs-toolbar ion-toolbar.toolbar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

I've also added those lines to get proper spacing in landscape mode for the content

ion-app.ios .scroll-content {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

from ionic-super-tabs.

ihadeed avatar ihadeed commented on August 25, 2024

It is on a real device and on Ionic Serve Lab

I just tested it on Ionic Serve Lab using version 2.6.0 and it looks fine. It might be fixed in the new release? can you please check and let me know.

from ionic-super-tabs.

danielehrhardt avatar danielehrhardt commented on August 25, 2024

yes seems to be fixed. Thank You!!

from ionic-super-tabs.

cjdreiss avatar cjdreiss commented on August 25, 2024

Hello, I just started using your project today. I'm still getting this issue in both lab and on my actual device.

Some version info from my package.json: (i can upload more if needed)
"ionic-angular": "3.3.0",
"ionic2-super-tabs": "^2.6.2",

img_4142

screen shot 2017-05-30 at 3 27 13 pm

from ionic-super-tabs.

cjdreiss avatar cjdreiss commented on August 25, 2024

So I did some digging, it looks like its about 20px off. There is a css rule that is being applied to nav bars, but its very specific and since your new tabs doesnt have the ion-tabs attribute it doesn't get the styling applied. Its adding 20px to the height of the navbars it looks like.

Here's some screenshots and the actual super long and specific selector. NOTE: I just switched to material for all platforms, but it still has the issue. I'm sure there is a similar css selector for ios

screen shot 2017-05-31 at 1 07 08 pm

screen shot 2017-05-31 at 1 07 44 pm

.md ion-nav > .ion-page > .toolbar.statusbar-padding:first-child, 
.md ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child, 
.md ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child, 
.md ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child, 
.md ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child, 
.md ion-menu > .menu-inner > ion-header > 
.toolbar.statusbar-padding:first-child {
    padding-top: calc(20px + 4px);
    min-height: calc(56px + 20px);
}

I just went in to my app.scss file for now and added the following:

// fix for super-tabs on ios
.md ion-nav > .ion-page > .toolbar.statusbar-padding:first-child,
.md ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.md ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.md ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,

.md super-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.md super-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,

.md ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child,
.md ion-menu > .menu-inner > ion-header > .toolbar.statusbar-padding:first-child {
  padding-top: calc(20px + 4px);
  min-height: calc(56px + 20px);
}


.ios ion-nav > .ion-page > .toolbar.statusbar-padding:first-child,
.ios ion-nav > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios ion-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,

.ios super-tab > .ion-page > ion-header > .toolbar.statusbar-padding:first-child,
.ios super-tabs > .ion-page.tab-subpage > ion-header > .toolbar.statusbar-padding:first-child,

.ios ion-menu > .menu-inner > .toolbar.statusbar-padding:first-child,
.ios ion-menu > .menu-inner > ion-header > .toolbar.statusbar-padding:first-child {
  padding-top: calc(20px + 4px);
  min-height: calc(44px + 20px);
}

from ionic-super-tabs.

danielehrhardt avatar danielehrhardt commented on August 25, 2024

@cjdreiss
My solution is much smaller is this not working?

// Ionic Super Tabs iOS Fix
super-tabs-container {
    ion-header {
        .toolbar {
            padding-top: calc(20px + 4px);
            min-height: calc(44px + 20px);
            .title {
                padding-top: 20px;
                height: calc(44px + 20px);
                min-height: calc(44px + 20px);
            }
        }
    }
}

from ionic-super-tabs.

cjdreiss avatar cjdreiss commented on August 25, 2024

@danielehrhardt it looks like it would work. I didn't try yours in the first place because I saw that 2.6 was thought to have fixed it.

Then after doing some debugging I saw all the selectors that Ionic was using so I figured it would be best to just add the super-tab/s to the list and do what is done in the framework.

from ionic-super-tabs.

silverio avatar silverio commented on August 25, 2024

hi @trytuna your fix isn't working anymore on iPhone X (it works fine for other iOS devices), this is how it looks.

screen shot 2017-12-15 at 12 59 03 pm

from ionic-super-tabs.

trytuna avatar trytuna commented on August 25, 2024

I've updated my last post. constant is deprecated since iOS 11.2 env should be used instead.

from ionic-super-tabs.

silverio avatar silverio commented on August 25, 2024

thanks for the update!!

from ionic-super-tabs.

Sulorb avatar Sulorb commented on August 25, 2024

A huge thanks trytuna, you saved my day !

from ionic-super-tabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.