我正面臨下一個問題,我的 Tab 文本逐漸消失,您看不到最后一個字母。

Widget _tabBar() {
return TabBar(
onTap: (tabIndex) {
setState(() {
_tabController.index = tabIndex;
});
},
padding: EdgeInsets.zero,
controller: _tabController,
labelColor: currentTheme.currentAppTheme.colorAccent,
unselectedLabelColor: currentTheme.currentAppTheme.tabInactiveColor,
labelStyle: const TextStyle(fontSize: 10),
indicatorColor: currentTheme.currentAppTheme.colorAccent,
indicatorPadding: EdgeInsets.zero,
indicatorWeight: 4,
tabs: [...],
);
}
uj5u.com熱心網友回復:
我已經接近的解決方案是添加labelPadding

labelPadding: EdgeInsets.zero,
PS您也可以將 Flutter sdk Tab 小部件方法_buildLabelText從更改TextOverflow.fade為TextOverflow.visible,但這有點混亂的解決方案
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/486957.html
上一篇:gtk_widget_destroy:斷言“GTK_IS_WIDGET(小部件)”失敗
下一篇:FlutterOTP點占位符UI
