Hi, what composable or modifier can i use to control layout positioning? I am messing with the compo...
j
Hi, what composable or modifier can i use to control layout positioning? I am messing with the compose Greeting Tutorial and I added a TopAppBar and the composables are stacking on top of eachother instead of laying out sequentially. Thanks!
This is what it looks like
f
If you are just starting out I suggest doing the Compose codelabs first but the answer to your question is in your
HelloContent
composable: Column. Column arranges items "sequentially" from top to down. For horizontal layouts there is Row
k
You'd probably want to use
Scaffold
with top app bar and main content
👆 1
j
@Filip Wiesner There is a column in the content. Putting the top app bar in the column means the app bar has the column padding which I don't want. I'll check out the codelabs thanks!
I'll check out
Scaffold
@Kirill Grouchnikov thanks.
f
In this exact scenario with
TopAppBar
it's better to use
Scaffold
because it's designed to do exactly this. But to explain, the AppBar in your example is outside of the column so the content is drawn over it. You could do something like this
Copy code
Column
  AppBar
  Column
      OutlinedTextField
j
oooo i see what you are saying
gotcha
thanks!
f
I really suggest you to do this layout codelab first if you are unsure of how things work.
j
yes i plan to. I was just getting started in reading from the initial tutorial.
👌 1