“溢出”已被弃用,不应使用。改用 clipBehavior

Nam*_*tar 5 flutter flutter-layout

我需要一个使用剪辑行为的溢出小部件,但我不知道该怎么做?

 child: Row(
    children: [
        Stack(
            children: [],
        overflow: Overflow.clip,
                                  ) 
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

Cop*_*oad 12

clipBehavior像这样使用:

Stack(
  clipBehavior: Clip.none, // This is what you need. 
  children: [],
)
Run Code Online (Sandbox Code Playgroud)

  • 如果我想要overflow.visible怎么办? (5认同)
  • @AnAndroid 这正是 `Clip.none` 正在做的事情。 (5认同)