对齐左侧的可滚动标签 [英] Align Scrollable Tabs On Left

查看:65
本文介绍了对齐左侧的可滚动标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将标签设置为可滚动时,它将所有标签设置为中心.但是我想找到一种方法,可以将所有选项卡向左对齐.有没有办法让我将左侧的标签对齐而不是居中对齐?这是我的代码.谢谢.

When i set my tabs to scrollable, it will set all my tabs to the center. But i want to find a way that i can align all the tabs to the left. Is there a way for me align the tabs on the left instead of center? Here is my code. Thank you.

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: colorPrimary,
        accentColor: colorAccent,
      ),
      home: DefaultTabController(
        length: 3,
        child: Scaffold(
          resizeToAvoidBottomPadding: false,
          appBar: AppBar(
            bottom: TabBar(
              tabs: [
                Tab(
                  child: Text(sign_in),
                ),
                Tab(
                  child: Text(sign_up),
                ),
                Tab(
                  child: Text(reset_password),
                ),
              ],
              indicatorColor: colorWhite,
              isScrollable: true,
            ),
          ),
          body: TabBarView(
            children: [
              SignIn(),
              SignUp(),
              ResetPassword(),
            ],
          ),
        ),
      ),
    );
  }
}

推荐答案

对于那些感兴趣的人,这是

For those who are interested, this is the answer that works form me

这篇关于对齐左侧的可滚动标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆