Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
Ionic: Scrollable areas with fixed areas layout

I'm having some trouble in an app I'm developing in which the client wants to have some fixed areas which contains tabs and filters, and one infinite scroll main area which contains the corresponding data which is selected on the tabs and filtered:

enter image description here

I've tried different options to accomplish this layout, and got some issues in each case:

  • Wrap all the main area (yellow + blue) in an non scrollable ion-content, make the blue area scrollable, covering the rest of the screen with flexbox. Issues: infinite scroll is not working, since it needs ion-content as the scrollable area. I have the feeling that the layout is not very solid and could act unexpectedly. Also, from the UX perspective most users are used to be able to scroll in the whole screen and not only on an area
  • Use the ion-content tag around the blue area. Issues: header and footer are misplaced
  • What I think might be the best way to go: Wrap ion-content around yellow and blue area and make yellow area floating (slot="fixed"). Issues: I don't want to set a fixed top margin in the blue area since this height may change depending on the device being used. Maybe this could be done programmatically, but I'd rather do it with just CSS

Also, maybe is possible to include the yellow area in the ion-header, but I find this very inflexible, and hard to structure. In this case, the tabs headers would be in ion-header, while the content in ion-content, which seems pretty weird from my point of view.

Any ideas in how to achieve this?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

put the fixed content into the header itself wrapping in a ion row

<ion-header>
    <ion-toolbar>
        <ion-buttons slot="start">
            <ion-menu-button></ion-menu-button>
        </ion-buttons>
        <ion-title>Header Title</ion-title>
    </ion-toolbar>
    <ion-row class="filter-row">
        <ion-col>
            <span>All</span>
        </ion-col>
        <ion-col>
            <span>High</span>
        </ion-col>
        <ion-col>
            <span>Medium</span>
        </ion-col>
        <ion-col>
            <span>Low</span>
        </ion-col>
        <ion-col>
            <span>No Priority</span>
        </ion-col>
    </ion-row>
</ion-header>

If you don't want to put the tabs into header, here is the second solution you can use

wrap the fixed tabs and other stuff you want to be fixed at the top below header into a div and add position sticky to the div with these css properties

    position: sticky;
    top: 0;
    z-index: 1;
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda