【问题标题】:React Material UI Grid oversize full screenReact Material UI Grid 超大全屏
【发布时间】:2018-08-07 22:35:54
【问题描述】:

使用Material UI Grid,这有超大全屏并生成水平滚动条,如何解决?

const styles = theme => ({ root: { flexGrow: 1,}, paper: {  padding: theme.spacing.unit * 2,textAlign: 'center',color: theme.palette.text.secondary,},});

生成horizontal scroll bar

【问题讨论】:

  • 不太清楚你在问什么。您认为您可以详细说明一下,并包括您目前编写的代码吗?

标签: reactjs material-ui


【解决方案1】:

我遇到了同样的问题。发现使用minHeight: "100vh"可以解决这个问题

root: {
  minHeight: "100vh",
}

where i found this solution

波纹管也起作用了:

root: {
  position: 'fixed',
  width: '100%',
  height: '100%',
  left: 0,
  top: 0,
  zIndex: 10,
}

where i found this solution

【讨论】:

    【解决方案2】:

    经过太多的测试,我解决了这个问题,将间距 24 更改为 16,因为孩子有 12,我希望这可以帮助某人

      <Grid container spacing={16}>
    

    Without horizontal scroll bar

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-24
      • 1970-01-01
      • 2021-05-03
      • 2022-10-20
      • 1970-01-01
      • 2016-02-13
      • 1970-01-01
      相关资源
      最近更新 更多