因为此次提交: https://github.com/callemall/material-ui/commit/11695dcfa01e802797115d42c6d3d82d7657b6ab#diff-e9014062cd8e3b4344ab619966f35ef2如何使小吃店在全屏小屏幕上拍摄?
快餐栏不占用移动屏幕中的100%宽度。任何人都可以帮助在100%宽度仍然可以在小屏幕的情况下给予帮助吗?
- >在此提交之前,宽度:'自动'做了伎俩,但现在没有更多。
任何帮助表示赞赏。
因为此次提交: https://github.com/callemall/material-ui/commit/11695dcfa01e802797115d42c6d3d82d7657b6ab#diff-e9014062cd8e3b4344ab619966f35ef2如何使小吃店在全屏小屏幕上拍摄?
快餐栏不占用移动屏幕中的100%宽度。任何人都可以帮助在100%宽度仍然可以在小屏幕的情况下给予帮助吗?
- >在此提交之前,宽度:'自动'做了伎俩,但现在没有更多。
任何帮助表示赞赏。
您可以使用媒体查询:
@media only screen and (max-width : 480px) {
.yourClass { width: 100%; }
}
嗯,我想通了,只需要传递{宽度:“100%”}在bodyStyle道具,它从它覆盖。
对我很好!谢谢! –
订阅的Github问题可以在https://github.com/angular/material2/issues/1951找到。这似乎不适用于使用'openFromComponent'打开的小吃店,并且它似乎在使用“open” – mtpultz
宽度不适用于我,因为它没有影响不知道为什么。虽然我设置为100%,但宽度仅取默认值。我能够使用minWidth应用全宽,并且我正在使用material-ui版本:0.18.7。您必须重写minWidth值以应用自定义宽度。请在下面找到示例
import Snackbar from 'material-ui/Snackbar';
const bodyStyle = {
border: `2px solid ${config.actualWhite}`,
height:55,
minWidth: 1385,
background: config.snackbarColor,
fontFamily: config.fontFamily,
fontStyle: config.fontStyle,
fontWeight: config.fontWeight,
fontSize: config.fontSize,
borderBottomRightRadius: 46,
borderBottomLeftRadius: 46
}
<Snackbar
open={this.state.open}
message={this.state.error}
autoHideDuration={4000}
bodyStyle={bodyStyle}
action="Close"
onRequestClose={this.handleRequestClose}
onActionTouchTap={this.handleRequestClose}
style={myTheme.snackbarfromTop}
/>
它给出了内联样式,并且没有在prop中使用类名。我想出了解决方案并发布了它。我们需要使用bodyStyle道具。 –