小编Vij*_*jay的帖子

如何使用 Flutter 中的 Stack 小部件部分覆盖视图

我正在使用 Flutter 进行我的应用程序开发。我想将海报图像视图叠加在背景图像之上,就像下面的屏幕截图一样。 在此处输入图片说明 下面的代码片段做到了这一点,但它要求我还根据海报的位置和背景图像的位置定位所有其他小部件,包括电影标题、发布日期等,这在多个设备和方向上是不可靠的。是否有解决此问题的示例或建议?

    @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new PlatformAdaptiveAppBar(
        title: new Text(widget.movie.title),
      ),
      body: new Container(
          constraints: new BoxConstraints.expand(),
          child: new Stack(
            children: <Widget>[
              new Container(
                child: new Image(
                    image: new AdvancedNetworkImage(
                        movieGridUtil.getUrlFromPath(widget.movie.backdrop_path,
                            MovieGridImageTypes.BACKDROP),
                        useMemoryCache: false,
                        useDiskCache: true)),
                constraints: new BoxConstraints.expand(height: 250.0),
              ),
              new Positioned(
                  left: 12.0,
                  top: 220.0,
                  child: new Image(
                    width: 100.0,
                    height: 150.0,
                    image: new AdvancedNetworkImage(
                        movieGridUtil.getUrlFromPath(widget.movie.poster_path,
                            MovieGridImageTypes.POSTER),
                        useMemoryCache: false,
                        useDiskCache: true),
                  )),
            ],
          )),
    );
  }
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout

8
推荐指数
2
解决办法
1万
查看次数

Tab 键在 Android Studio 中不起作用

我安装了 Android Studio 0.8.0 版,键盘上的 TAB 键没有在 Android Studio 的编辑器窗口中插入实际的选项卡。但我的 TAB 键一般工作正常。

有人好心帮忙,因为我无法弄清楚这一点。谢谢。

tabs android android-studio

5
推荐指数
1
解决办法
3448
查看次数

标签 统计

android ×1

android-studio ×1

dart ×1

flutter ×1

flutter-layout ×1

tabs ×1