如何使材料UI的组件响应?
我对材料UI是相对较新的,并且已经设计了类型搜索的文本字段。我希望它能迅速响应。但是我无法在屏幕尺寸的屏幕尺寸中渲染宽度小于423
<Box
sx={{ flexGrow: 1 }}
m={5} pt={5}
display="flex"
justifyContent="flex-end"
alignItems="flex-end"
>
<Grid item sx={{ flexGrow: 1 }} spacing={{ xs: 1, md: 2,lg:2}} columns={{ xs: 2, sm: 2, md: 12 ,lg: 22}} display="flex"
justifyContent="center"
alignItems="center" marginLeft={8} marginRight={1} mt={4} width='100%'>
<SearchIcon style={{ coSelf: "center", margin: "5px" }} />
<TextField
id="standard-search"
label="Search for a company..."
type="search"
variant="standard"
textAlign="center"
fullWidth
/>
</Grid>
<Button onClick={() => setLight((prev) => !prev)} variant="contained" color="primary" sx={{ height: 40 }}>
<SettingsIcon/>
</Button>
</Box>
任何帮助都将不胜感激。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您的搜索组件是渲染的,但藏在股票市场图表标题后面,因为它的屏幕尺寸较小。如果将其作为
固定
位置,请尝试将其更改为相对
位置,或删除/减少其中的文本,以便快速测试变短,并可能显示搜索成分。Seems your search component is rendered but hiding behind the Stock Market Charting header as it gets longer in smaller screen sizes. If you have it as a
fixed
position try changing it torelative
position, or remove/reduce the text inside it so it gets shorter for a quick test and might reveal the search component.