flutter - 在标签栏中向右溢出 88 像素颤振标签栏
问题描述
我正在使用颤振开发移动应用程序,我制作了一个图标和文本标签栏,但结果正好溢出了 88 像素 这是结果的屏幕截图
这是代码
bottom: new TabBar(controller: controller,
tabs: <Widget>[
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.local_hospital,color: Colors.white),
new Text ( "كلام",
style:TextStyle(color: Colors.white,
)),
]),
),
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.school,color: Colors.white),
new Text ( "كلام",style:TextStyle(
color: Colors.white
)),
]),
),
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.account_balance,color: Colors.white),
new Text ( "كلام" ,style:TextStyle(
color: Colors.white
)),
]),
),
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.account_balance,color: Colors.white),
new Text ( "كلام" ,style:TextStyle(
color: Colors.white
)),
]),
),
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.account_balance,color: Colors.white),
new Text ( "كلام" ,style:TextStyle(
color: Colors.white
)),
]),
),
new Tab(
child: new Row(
children: <Widget>[
new Icon(Icons.account_balance,color: Colors.white),
new Text ( "كلام" ,style:TextStyle(
color: Colors.white
)),
]),
),
],),
),
我该如何处理?我试图做一个水平滚动,但我失败了!谁能帮我 ?
解决方案
您可以尝试在小部件上使用isScrollable: true吗?TabBar
如下
TabBar(
indicatorSize: TabBarIndicatorSize.tab,
isScrollable: true,
tabs: [
Tab(
child: Row(children: <Widget>[
Icon(Icons.local_hospital, color: Colors.white),
Text("كلام",
style: TextStyle(
color: Colors.white,
)),
]),
),
Tab(
child: Row(children: <Widget>[
Icon(Icons.account_balance, color: Colors.white),
Text("كلام", style: TextStyle(color: Colors.white)),
])),
Tab(
child: Row(children: <Widget>[
Icon(Icons.account_balance, color: Colors.white),
Text("كلام", style: TextStyle(color: Colors.white)),
]),
),
Tab(
child: Row(children: <Widget>[
Icon(Icons.mail, color: Colors.white),
Text("كلام", style: TextStyle(color: Colors.white)),
]),
),
Tab(
child: Row(children: <Widget>[
Icon(Icons.access_alarm, color: Colors.white),
Text("كلام", style: TextStyle(color: Colors.white)),
]),
),
Tab(
child: Row(children: <Widget>[
Icon(Icons.add_to_photos, color: Colors.white),
Text("كلام", style: TextStyle(color: Colors.white)),
]),
),
],
)
希望这有帮助。
推荐阅读
- python - 试图在 python 中抓取 .aspx 站点,但它不会发布
- iframe - 如何从此 IFRAME 代码中删除滚动条?
- haskell - (如何)我可以在 CentOS / Ubuntu 上的 Windows 上托管 Haskell 网站吗?
- r - 用 R 预测
- node.js - 部署在 Azure 中的 nodejs 服务器正在输出内容长度
- linux - 在shell中为递归扩展变量添加前缀
- airflow - 如何用airflow实现更复杂的dag调度?
- html - 不确定 HTML 是否使用 CSS 文件,因为对 CSS 文件所做的更改不会显示在网页上。我该怎么办?
- java - 用户看不到的 RecyclerView 上的项目内部的计时器没有启动,
- reactjs - 制作树时无法使用上下文 API