【发布时间】:2018-10-03 07:25:14
【问题描述】:
在Android中,我们可以根据TextView的大小,使ImageView尽可能的填充空间。
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
我们如何在Flutter 中实现这一点?假设我需要让Datetime(green) 尽可能地填充。
new Column(
children: <Widget>[
new Text('Title',
style: new TextStyle(fontWeight: FontWeight.bold)
),
new Text('Datetime',
style: new TextStyle(color: Colors.grey)
),
],
)
【问题讨论】:
-
您不想填满图像,而不是填满文字吗?这是一个完全不同的主题,使字体变大
-
我已经编辑了这个问题。请忽略图像,基本上我只是想让日期时间(绿色的那个)根据标题的大小填充尽可能多的高度。字体不会改变。
标签: flutter dart flutter-layout