- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试使用 Material UI 网格系统设置一个组件。
到目前为止,这是我组件中的代码
<Container maxWidth="lg" className={classes.container}>
<Grid container spacing={4}>
<Paper className={classes.paper}>
<Grid item xs={12} lg={6} style={{padding: '10px'}}>
<CardActionArea component="a" href="#">
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent>
<Typography component="h2" variant="h5">
<Title size={'28px'}>Name</Title>
</Typography>
<Typography variant="subtitle1" color="grey">
Occupation
</Typography>
<Typography variant="subtitle1" paragraph>
Mauris eu porttitor dolor. Nulla pellentesque imperdiet sodales. Morbi tincidunt mattis ex eu molestie. Suspendisse scelerisque est vel mi volutpat tincidunt. Nulla felis odio, suscipit accumsan mollis vel, semper eget dui. Etiam eget hendrerit neque, vitae ornare nisi. Duis tincidunt erat vel nulla iaculis, vel viverra orci varius. Duis risus velit, tempus bibendum justo eu, blandit pulvinar libero. Aliquam ornare dui ut risus finibus, sit amet laoreet purus ultricies.
</Typography>
<CardMedia
className={classes.media}
title="image picture"
image="https://www.ucd.ie/sportandfitness/t4media/Banner---PT-Course.jpg" />
</CardContent>
</div>
<p>Hello</p>
</Card>
</CardActionArea>
</Grid>
<Grid item xs={12} lg={6} style={{padding: '10px'}}>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent>
<Typography component="h2" variant="h5">
<Title size={'28px'}>Name</Title>
</Typography>
<Typography variant="subtitle1" color="grey">
Occupation
</Typography>
<Typography variant="subtitle1" paragraph>
Mauris eu porttitor dolor. Nulla pellentesque imperdiet sodales. Morbi tincidunt mattis ex eu molestie. Suspendisse scelerisque est vel mi volutpat tincidunt. Nulla felis odio, suscipit accumsan mollis vel, semper eget dui. Etiam eget hendrerit neque, vitae ornare nisi. Duis tincidunt erat vel nulla iaculis, vel viverra orci varius. Duis risus velit, tempus bibendum justo eu, blandit pulvinar libero. Aliquam ornare dui ut risus finibus, sit amet laoreet purus ultricies.
</Typography>
<CardMedia
className={classes.media}
title="image picture"
image="https://www.ucd.ie/sportandfitness/t4media/Banner---PT-Course.jpg" />
</CardContent>
</div>
<p>Hello</p>
</Card>
</Grid>
</Paper>
</Grid>
</Container>
这是桌面 View
问题是,无论何时在桌面模式下查看,我都希望两个网格在同一行上。它们非常适合移动设备和较小的屏幕,但我无法将这两个组件包装在桌面设备中,我该如何更改?
最佳答案
我认为问题是因为您使用了 <Paper>
引起的Grid 容器中的组件。<Grid>
的直接 child 容器,应该是另一个<Grid>
组件。
尝试包装 <Paper>
<Grid>
周围.像这样:
<Container maxWidth="lg" className={classes.container}>
<Paper className={classes.paper}>
<Grid container spacing={4}>
<Grid item xs={12} lg={6} style={{padding: '10px'}}>
<CardActionArea component="a" href="#">
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent>
<Typography component="h2" variant="h5">
<Title size={'28px'}>Name</Title>
</Typography>
<Typography variant="subtitle1" color="grey">
Occupation
</Typography>
<Typography variant="subtitle1" paragraph>
Mauris eu porttitor dolor. Nulla pellentesque imperdiet sodales. Morbi tincidunt mattis ex eu molestie. Suspendisse scelerisque est vel mi volutpat tincidunt. Nulla felis odio, suscipit accumsan mollis vel, semper eget dui. Etiam eget hendrerit neque, vitae ornare nisi. Duis tincidunt erat vel nulla iaculis, vel viverra orci varius. Duis risus velit, tempus bibendum justo eu, blandit pulvinar libero. Aliquam ornare dui ut risus finibus, sit amet laoreet purus ultricies.
</Typography>
<CardMedia
className={classes.media}
title="image picture"
image="https://www.ucd.ie/sportandfitness/t4media/Banner---PT-Course.jpg" />
</CardContent>
</div>
<p>Hello</p>
</Card>
</CardActionArea>
</Grid>
<Grid item xs={12} lg={6} style={{padding: '10px'}}>
<Card className={classes.card}>
<div className={classes.cardDetails}>
<CardContent>
<Typography component="h2" variant="h5">
<Title size={'28px'}>Name</Title>
</Typography>
<Typography variant="subtitle1" color="grey">
Occupation
</Typography>
<Typography variant="subtitle1" paragraph>
Mauris eu porttitor dolor. Nulla pellentesque imperdiet sodales. Morbi tincidunt mattis ex eu molestie. Suspendisse scelerisque est vel mi volutpat tincidunt. Nulla felis odio, suscipit accumsan mollis vel, semper eget dui. Etiam eget hendrerit neque, vitae ornare nisi. Duis tincidunt erat vel nulla iaculis, vel viverra orci varius. Duis risus velit, tempus bibendum justo eu, blandit pulvinar libero. Aliquam ornare dui ut risus finibus, sit amet laoreet purus ultricies.
</Typography>
<CardMedia
className={classes.media}
title="image picture"
image="https://www.ucd.ie/sportandfitness/t4media/Banner---PT-Course.jpg" />
</CardContent>
</div>
<p>Hello</p>
</Card>
</Grid>
</Grid>
</Paper>
</Container>
关于javascript - 在大屏幕上使 material-ui 网格环绕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58606330/
是否可以在 android list 文件中禁用对超大屏幕的支持?我们已经开发了一个应用程序,但还没有改变平板电脑的设计,所以我们想在以后的版本中禁用平板电脑支持。 我们使用 phonegap/htm
我查到的信息:320dp:典型的手机屏幕(240x320 ldpi、320x480 mdpi、480x800 hdpi 等)。480dp:类似 Streak 的补间数位板 (480x800 mdpi)
我创建了 4 个不同的布局文件并将它们放在 layout , layout-small,layout-large,layout-xlarge. 文件夹和在 QVGA、HVGA 和 WXGA 仿真器中测
我有一个名为 showPage 的节目转场从 View Controller 到 TableView Controller ,我正在调用 performSegueWithIdentifier()在单击
我是一名优秀的程序员,十分优秀!