首页 > 解决方案 > 文本不会显示在嵌套在 AbsoluteLayout 中的标签内

问题描述

我正在构建一个组件来显示水平堆叠的用户个人资料图片。在用户没有个人资料照片的情况下,他的第一个姓名字母将显示在堆栈内的气泡中。

我很难显示气泡内的文字。气泡的容器是一个带有圆形类的布局,其中包含一个包含文本的标签。

非常感谢这方面的任何帮助,因为它让我筋疲力尽:XXX

代码:

<AbsoluteLayout orientation="horizontal" style="background-color: #00fdd6">
<ng-template ngFor let-user [ngForOf]="users|limit:lengthLimit" let-i="index">
    <Image *ngIf="user.profile_photo" [src]="getImageUrl(user)" class="img-circle" height="50" width="50"
           left="{{stackProfilePhotos(i)}}"></Image>
    <RelativeLayout *ngIf="!user.profile_photo" style="border: #0000fe 5px solid; background-color: green;"
     class="img-circle" height="100" width="100" top="-25" left="{{stackProfileLetterBubble(i)}}">
        <Label text="M" HorizontalOptions="CenterAndExpand" VerticalOptions="Center" TextColor="White" FontSize="24"></Label>
    </RelativeLayout>
</ng-template>

附上ui的视图

标签: androidhtmltypescriptnativescript

解决方案


推荐阅读