我有一個小部件,無論出于何種原因不想轉到螢屏底部。現在螢屏看起來像:
body: Stack(
children: <Widget>[
SingleChildScrollView(
child: //make a widget that looks like twitter composing tweet
Column(
children: [
//make a widget that looks like twitter composing tweet
Container(
padding: const EdgeInsets.all(16),
child: Row(
children: [
//make a widget that looks like twitter composing tweet
CircleAvatar(
radius: 20,
backgroundImage: NetworkImage(user.imageUrls[0]),
),
//make a widget that looks like twitter composing tweet
const SizedBox(
width: 16,
),
//make a widget that looks like twitter composing tweet
Expanded(
child: TextField(
maxLength: 280,
controller: _textEditingController,
maxLines: null,
decoration: InputDecoration(
hintText: 'What\'s happening?',
border: InputBorder.none,
),
),
),
],
),
),
//make a widget that looks like twitter composing tweet
if (_image != null)
Image.file(
_image!,
height: 200,
width: 200,
),
Align(
alignment: Alignment.bottomCenter,
child: ComposeBottomIconWidget(
onImageIconSelected: _onImageIconSelected,
textEditingController: _textEditingController,
),
),
],
),
),
],
),
結果是:

知道為什么這看起來像這樣嗎?小部件被包裹在對齊中,但仍然沒有改變。任何想法表示贊賞,謝謝!
uj5u.com熱心網友回復:
您還可以使用 spacer() 在它們之間留出空間。
uj5u.com熱心網友回復:
在 Expanded 中包裹 SingleChildScrollView
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/534248.html
標籤:扑用户界面前端空格
