我想要一个图像上的对齐,所以我创建了一个堆栈,它的孩子是一个图像和一个对齐(CircleAvatar CircleAvatar )。
看起来一切正常,但是我不能在y轴上移动CircleAvatar,只能在x轴上移动,我真的需要在y轴上移动它。
代码:
body: new Stack(
children: <Widget>[
new ListView(
children: <Widget>[
new Stack(
children: <Widget>[
new Image.asset(
我试图创建一个横向滚动列表的项目在颤振,我希望这个列表只占必要的高度基础上它的孩子。通过设计“ListView试图扩展以适应其交叉方向上的可用空间”(来自),我也注意到它占据了整个视口的高度,但是有什么方法可以让它不这样做呢?理想情况下,类似于此(显然不起作用):
new ListView(
scrollDirection: Axis.horizontal,
crossAxisSize: CrossAxisSize.min,
children: <Widget>[
new ListItem(),
new ListItem(),
// ...
我正在使用Flexbox,但是当我尝试将父div的高度/宽度设置为auto时,似乎出现了一个问题。
指南
.parent {
background: #000;
width:100px; /* I WANT TO SET THIS AUTO ** NOT FIX 100PX** */
height:100px; /* I WANT TO SET THIS AUTO ** NOT FIX 100PX** */
}
.child {
display: flex;
color:white;
flex-direction: colum
我偶然发现了一些发生在我的弹性子项目上的事情,如所示。
这是代码:
<div style="position:absolute; top:10px; left:10px; background-color:yellow; height:50px; width:200px; display:flex; flex-direction:column;">
<div style="overflow:hidden;">inner div text<br>inner div text<br>inner div text
总共有三个文件: Home.dart、Post.dart和PostBuilder.dart
在Home.dart中,我有一个listView.seperated:
List post = [];
void initState() {
super.initState();
getPost();
}
Future getPost()async
{
//function that gets and paginates the data from the backend and adds it to the list.
}
body: ListView.separated(