0Pricing
Jetpack Compose Academy · Aula

Barras Inferiores e Botões de Ação Flutuantes

Fixe a navegação e as ações principais.

Barras Inferiores e Botões de Ação Flutuantes é uma aula grátis de Jetpack Compose Academy no CoddyKit. Esta é a aula 3 de 4. Você pode ler a aula completa abaixo gratuitamente — depois pratica ao vivo no navegador com um editor de código integrado e um tutor de IA 24/7. Faz parte do caminho de aprendizado de Jetpack Compose Academy, e seu progresso é sincronizado entre a web e o app CoddyKit. O curso de Jetpack Compose Academy inclui 4 aulas no total.

Partes desta aula ainda não foram traduzidas e aparecem em inglês.

Anchoring the Bottom

The thumb-friendly zone of a phone is the bottom. Scaffold's bottomBar and floatingActionButton slots put your key controls right where fingers reach. 👍

The bottomBar Slot

Whatever you place in the bottomBar slot is pinned to the bottom, and Scaffold shrinks the content area so nothing slides behind it.

Scaffold(
    bottomBar = { BottomAppBar { Text("Tools") } }
) { p -> }

BottomAppBar

BottomAppBar is a Material container for actions tied to the current screen, like edit or share buttons. It is a RowScope, so children flow left to right.

Meet the FAB

A FloatingActionButton is the round, raised button for the single most important action on a screen, like Add or Compose. ➕

FloatingActionButton(onClick = { }) {
    Icon(Icons.Default.Add, "Add")
}

The FAB Slot

Put your FAB in Scaffold's floatingActionButton slot, not in your content. Scaffold then floats it correctly above the bottom edge.

Scaffold(
    floatingActionButton = { FloatingActionButton(onClick = {}) {} }
) { p -> }

One FAB Per Screen

A FAB signals the primary action, so use just one per screen. Two competing FABs leave users unsure which one really matters.

FAB Position

Control where the FAB sits with floatingActionButtonPosition. The default is the bottom-right corner, but Center pairs nicely with a bottom bar.

floatingActionButtonPosition = FabPosition.Center

FAB Sizes

Beyond the standard FAB, Material 3 adds SmallFloatingActionButton and LargeFloatingActionButton so you can match the button to the screen's weight.

The ExtendedFAB

An ExtendedFloatingActionButton shows an icon plus a text label. It works well when the action's name is not obvious from an icon alone.

ExtendedFloatingActionButton(
    onClick = { },
    icon = { Icon(Icons.Default.Add, "Add") },
    text = { Text("New") }
)

Bars and FAB Together

Scaffold understands when a bottomBar and a FAB coexist, lifting the FAB so it never overlaps the bar. You just fill both slots.

Describe the FAB

Like any icon button, give the FAB's Icon a contentDescription. A bare plus sign means nothing to a screen reader without it.

Quick Check

How many FloatingActionButtons should a single screen normally show?

Recap

Use the bottomBar slot for screen actions and the floatingActionButton slot for one primary action. Scaffold spaces them so they never collide. ✨

Perguntas Frequentes

A aula “Barras Inferiores e Botões de Ação Flutuantes” é grátis?

Sim — o texto completo de “Barras Inferiores e Botões de Ação Flutuantes” é grátis para ler aqui na web. Para praticá-la interativamente (um editor de código integrado e um tutor de IA 24/7) e desbloquear o restante do curso de Jetpack Compose Academy, atualize para CoddyKit PRO. O curso de Jetpack Compose Academy inclui 4 aulas no total.

O que vou aprender em “Barras Inferiores e Botões de Ação Flutuantes”?

Fixe a navegação e as ações principais. Você pratica Jetpack Compose Academy com código prático que executa diretamente no navegador, e um tutor de IA 24/7 responde suas dúvidas enquanto trabalha na aula.

Preciso ter experiência prévia para começar Jetpack Compose Academy?

Nenhuma experiência prévia é necessária. Jetpack Compose Academy no CoddyKit é estruturado para alunos iniciantes até avançados, então você pode começar aqui ou desde o início e aprender no seu ritmo. Esta é a aula 3 de 4.

Quanto tempo leva a aula “Barras Inferiores e Botões de Ação Flutuantes”?

A maioria das aulas CoddyKit leva cerca de 5–10 minutos. Cada uma é compacta e interativa, então você faz progresso constante e retoma exatamente de onde parou entre web e app.

Posso escrever e executar código nesta aula de Jetpack Compose Academy?

Sim. Cada aula de Jetpack Compose Academy inclui um editor de código integrado, então você escreve e executa código real direto no navegador e recebe feedback de IA instantaneamente — nenhuma configuração local necessária.

Todas as aulas deste curso

  1. Scaffold: A Estrutura da Tela
  2. TopAppBar e Ícones de Ação
  3. Barras Inferiores e Botões de Ação Flutuantes
  4. Snackbars e SnackbarHostState
← Voltar para Jetpack Compose Academy