AppBar固定在顶部后内容被遮挡怎么办?
我用 Material-UI 的 AppBar 设置了 position=”fixed”,结果下面的页面内容被挡住了,试过加 padding 但不太稳定,有没有标准做法?
比如我在 AppBar 下面放了个 <div>,即使给它加 paddingTop: 64,在不同设备上还是会被盖住。
import { AppBar, Toolbar, Typography } from '@mui/material';
function Header() {
return (
<AppBar position="fixed">
<Toolbar>
<Typography variant="h6">My App</Typography>
</Toolbar>
</AppBar>
);
}
暂无解答