我想在NestedScrollView
中放一个页脚。我有以下设置:
<android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.AppBarLayout>
<android.support.v7.widget.Toolbar/>
</android.support.design.widget.AppBarLayout>
<NestedScrollView>
<LinearLayout>
<TextView/>
<FooterView/>
</LinearLayout>
</NestedScrollView>
</android.support.design.widget.CoordinatorLayout>
TextView
只是一个例子。想象它是一个长内容,它使NestedScrollView
可滚动。当前,FooterView
与其他内容一起上下滚动。我想要的是:
-它始终位于屏幕底部(如反向Toolbar
)。这意味着,如果NestedScrollView
内容很短,则它仍应位于屏幕底部。
-向下滚动NestedScrollView
时,它在底部保持粘性。
现在,我正在想象这完全是AppBarLayout's
的行为,但是方向相反。您是否知道以这种方式运行的视图,或者可以为我提供如何实现这种行为的指导?
作为参考,我附上了AppBarLayout
的行为,但我的看法却相反:
请注意,蓝色Toolbar
和黄色TextView
是AppBarLayout
的一部分,AppBarLayout
让TextView
滚动,同时保持{{1} }位于顶部。