我要删除上图中突出显示的边框。我找不到任何解决方案来解决这个问题:(
这是我的SliverAppBar代码:
SELECT *
FROM ProductAndServices
WHERE
(@Title IS NULL OR Title = @Title) AND
(@CreatedBy IS NULL OR CreatedBy = @CreatedBy)
答案 0 :(得分:1)
只需将elevation
属性设置为0
。
SliverAppBar(
title: Text('Applying to this job opportunity'),
pinned: true,
elevation: 0,
titleSpacing: 0,
floating: true,
expandedHeight: 180,
flexibleSpace: //some widgets
)
更多信息:https://api.flutter.dev/flutter/material/SliverAppBar/elevation.html
答案 1 :(得分:0)
答案 2 :(得分:0)
在我看来,底部边框仍然显示。它与此问题有关 https://github.com/flutter/flutter/issues/16262
因此,我必须将 Scaffold 的背景设置为与子小部件的背景相同才能解决此问题。
似乎只发生在某些手机上。
https://github.com/flutter/flutter/issues/16262#issuecomment-379071933
<块引用>如果您将 Scaffold 的主体包含在 SizedBox.expand 小部件中,则 body 将始终填充剩余空间。然后,正如你所指出的, 指定 Scaffold 的 backgroundColor,隐藏问题。
-> 有问题
for (Entity * cb : cbs)
{
delete cb;
}
-> 通过添加背景修复
Widget build(BuildContext context) {
return Scaffold(
body: CustomScrollView(
controller: _scrollController,
slivers: <Widget>[
SliverAppBar(
pinned: true,
snap: false,
floating: false,
elevation: 0.0, // Remove AppBar bottom border
leading: new Container(),
titleSpacing: 0,
expandedHeight: 100.0,
flexibleSpace: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
top = constraints.biggest.height;
return FlexibleSpaceBar(
centerTitle: true,
titlePadding: EdgeInsets.zero,
title: top >= 86
? null
: topToolBarWidget(),
background: sliverBackgroundWidget()
);
})),
SliverList(
delegate: SliverChildListDelegate(
[
PromotionSlider()
],
),
),
],
));
}