在 Twitter 上有很多猫咪在互相发推文。这太奇怪了,他们不应该拥有自己的社交媒体,Meowster 或 Yowwlr 吗?
— Jen ➰ (@jenlooper) 2016 年 12 月 26 日
<ScrollView>
<StackLayout>
<FlexboxLayout class="container" *ngFor="let yowl of (yowls$ | async)">
</FlexboxLayout>
</StackLayout>
</ScrollView>
.container {
border-bottom-width: 1;
border-color: lightgray;
align-items: flex-start;
padding: 5;
}
<Image class="column" src="~/images/k2" width="120" height="75"></Image>
<FlexboxLayout class="column">
</FlexboxLayout>
.column {
flex-direction: column;
flex-wrap: nowrap;
}
<FlexboxLayout class="row pad" justifyContent="space-between">
<Label class="bold" [text]="yowl.name"></Label>
<Label class="small" [text]="'@'+yowl.username"></Label>
<Label [text]="'fa-circle' | fonticon" class="fa grey tiny"></Label>
<Label class="small" text="{{yowl.date | date:'mm'}} m"></Label>
<Label [text]="'fa-chevron-down' | fonticon" class="fa grey small"></Label>
</FlexboxLayout>
<!-- yowl -->
<Label class="row regular" textWrap="true" [text]="yowl.text"></Label>
<FlexboxLayout class="row pad">
<Button width="25%" [text]="'fa-mail-reply' | fonticon" class="fa grey"></Button>
<Button width="25%" [text]="'fa-retweet' | fonticon" class="fa grey"></Button>
<Button width="25%" [text]="'fa-heart' | fonticon" class="fa grey"></Button>
<Button width="25%" [text]="'fa-envelope' | fonticon" class="fa grey"></Button>
</FlexboxLayout>
.row {
flex-direction: row;
flex-wrap: nowrap;
align-content: flex-start;
}
<FlexboxLayout class="column ry" borderWidth="1" borderColor="lightgray" borderRadius="2">
<FlexboxLayout class="row">
<Label class="bold" text="Mrs. Fluffypants"></Label>
<Label class="small" text="@mrsfluffypants"></Label>
</FlexboxLayout>
<Label class="row regular" textWrap="true" text="Reading your tweets is like lapping up a wonderful bowl of sweet cream."></Label>
</FlexboxLayout>
挑战:向此项目提交一个 PR,该 PR 将创建 Twitter 的另一个著名布局,例如推广的推文(即 Yowl),或一个主从页面,该页面将完整显示推文。或者更进一步,在选项卡视图中构建“我”页面。如果我接受您的 PR,我会给您寄一件 NativeScript T 恤!玩得开心,访问 http://www.github.com/jlooper/yowwlr 开始吧!