小编the*_*hem的帖子

向下滚动时隐藏的Flutter TabBar和SliverAppBar

我正在尝试使用顶部的应用程序栏和下面的标签栏创建一个应用程序。向下滚动时,应通过移出屏幕来隐藏该栏(但应保留选项卡),而向上滚动时,应再次显示该应用程序栏。可以在WhatsApp中看到此行为。请观看视频进行演示。(摘自Material.io)。是一个类似的行为,虽然应用程序栏和标签栏被隐藏在滚动,所以它不完全是我要找的行为。

我已经能够实现自动隐藏,但是存在一些问题:

  1. 我必须设置snapSliverAppBartrue。没有此功能,当我向上滚动时,应用程序栏将不会显示。

    尽管这是可行的,但这不是我想要的行为。我希望应用程序栏显示流畅(类似于WhatsApp),而不是即使滚动很少也不会显示。

  2. 当我向下滚动并更改选项卡时,部分内容会被遮挡掉。

    以下是显示行为的GIF:

    GIF展示输出

    (当我在listView(tab1)上向下滚动,然后移回tab2时,请参阅该部分)

这是代码DefaultTabController

DefaultTabController(
  length: 2,
  child: new Scaffold(
    body: new NestedScrollView(
      headerSliverBuilder:
          (BuildContext context, bool innerBoxIsScrolled) {
        return <Widget>[
          new SliverAppBar(
            title: Text("Application"),
            floating: true,
            pinned: true,
            snap: true,    // <--- this is required if I want the application bar to show when I scroll up
            bottom: new TabBar(
              tabs: [ ... ],    // <-- total of 2 tabs
            ), …
Run Code Online (Sandbox Code Playgroud)

android dart flutter flutter-sliver flutter-layout

8
推荐指数
4
解决办法
5950
查看次数

如何更改 Markdown pandoc 中的字体?

我正在用 Markdown 写一个文档,我读到我可以像这样将字体更改为 Arial:

---
fontfamily: arev
---
Run Code Online (Sandbox Code Playgroud)

但它没有用。但是当我尝试将字体更改为 Times 时,它工作正常

---
fontfamily: times
---
Run Code Online (Sandbox Code Playgroud)

那么如何将字体更改为 Arial?

markdown latex pandoc

5
推荐指数
0
解决办法
2524
查看次数