问题
How do I make an app bar that looks like this:
I can create the top half of the app bar with the search box but I'm having trouble adding the bottom half. This is my code so far:
<AppBar
style={{backgroundColor: MuiTheme.palette.primary1Color, flexWrap: 'wrap'}}
showMenuIconButton={false}
title={explorerSearch}
titleStyle={MuiTheme.title}
iconClassNameRight='muidocs-icon-navigation-expand-more'
>
<Toolbar>
<ToolbarGroup>
{this._getContent()}
</ToolbarGroup>
</Toolbar>
</AppBar>
This is what the output looks like:
I'd like the "TEXT" to show up in a new line below the search bar. How do I do that?
回答1:
Have you tried adding to styles flexDirection: 'column'
?
Just replace the style You got there:
style={{backgroundColor: MuiTheme.palette.primary1Color, flexWrap: 'wrap'}}
to
style={{backgroundColor: MuiTheme.palette.primary1Color, display: 'flex', flexDirection: 'column'}}
来源:https://stackoverflow.com/questions/40026643/how-to-make-an-app-bar-using-react-material-ui-like-this