简体   繁体   English

无法为 Material UI 中的选项卡应用水平滚动

[英]Unable to apply horizontal scroll for the Tabs in Material UI

I am unable to apply the horizontal scroll to the Tabs using material UI.我无法使用 Material UI 将水平scroll应用于选项卡。

below link is the material ui version i am using https://v0.material-ui.com/#/components/tabs下面的链接是我使用的材料 ui 版本https://v0.material-ui.com/#/components/tabs

The number of Tabs increasing its taking more width.标签的数量增加了它的宽度。

I trid to apply width, but its taking entire Tabs tab.我尝试应用宽度,但它占用了整个 Tabs 选项卡。

I need to apply only Tabs width and horizontal scroll.我只需要应用标签宽度和水平滚动。

 <Tabs inkBarStyle={{backgroundColor: 'blue'}} value={this.state.tableNameTab} onChange={this.handleChangeTab} key = "tabsData" style={{ maxWidth: "500px", overflow: "auto" }} > {this.state.TableDetails.map( (data,index) => <Tab label={data.tableName} value={data.tableName} key={'key'+index} > <h6>{data.tableName}</h6> </Tab> ) } </Tabs>

Welcome to SO!欢迎来到 SO!

Using scrollable-force-tab you can achieve inside scoll of tabs header利用scrollable-force-tab就可以实现内部scolltabs

Its mention in their Official Doc please have a look它在他们的 官方文档中提到请看一看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM