flutter TabBar改變tab大小


 

 被選中的tab變大

 

TabBar(
                        tabs: _tab.map((f) {
                          return Text(
                            f,
                            style: TextStyle(color: Colors.white), // 設置tab文字的樣式,優先級最高
                          );
                        }).toList(),
                        controller: _controller1,
                        indicatorColor: Colors.orange, // 下面那條橫線的顏色

                        indicatorSize: TabBarIndicatorSize.label, // 指示器是類型, label是這樣的,tab是沾滿整個tab的空間的
                        isScrollable: true, // 是否可以滑動
                        indicatorWeight: 3.0, // 指示器的高度/厚度
                        unselectedLabelStyle: TextStyle(fontSize: 16), // 未選擇樣式
                        labelStyle: TextStyle( fontSize: 20, height: 2), // 選擇的樣式




                        onTap: _tabChange
                    ),

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM