https://kotlinlang.org logo
#compose
Title
# compose
b

Brian Donovan

01/19/2022, 4:25 PM
Hey all, how can I add space between inside of the topAppBar? Should look like the figma
s

Stephen Prochnow

01/19/2022, 4:38 PM
You could add a
Spacer(modifier = Modifier.weight(1f))
in between both icons
b

Brian Donovan

01/19/2022, 4:41 PM
ty
c

Colton Idle

01/19/2022, 4:46 PM
Top bar has support for a navIcon which would show the left icon, and then for actions, which would show on the right. no need for a spacer
b

Brian Donovan

01/19/2022, 4:46 PM
Any way to get rid of the top elevation?
c

Chris Sinco [G]

01/19/2022, 4:50 PM
elevation = 0.dp?
You can’t easily only get rid of only top elevation
b

Brian Donovan

01/19/2022, 4:51 PM
That gets rid of the top and bottom. I only want the top one
oh
You guys see something wrong I did here?
c

Chris Sinco [G]

01/19/2022, 4:52 PM
Customizing shadow/elevation is non-trivial
Please provide the error(s)
b

Brian Donovan

01/19/2022, 4:56 PM
s

Stephen Prochnow

01/19/2022, 5:01 PM
I would guess the autcompletion selected one of the other overloads for the TopAppBar, try to remove the outside lambda at the end of your function
c

Chris Sinco [G]

01/19/2022, 5:04 PM
You may also be missing the title parameter
b

Brian Donovan

01/19/2022, 5:05 PM
I need a title parameter even if I only want to show 2 icons?
c

Chris Sinco [G]

01/19/2022, 5:07 PM
At the moment yes as that’s the expected method signature. But you can just set title to
{ }
(empty Composable)
b

Brian Donovan

01/19/2022, 5:11 PM
thanks everyone it works, it was the title parameter
3 Views