Nativescript + Angular:flexShrink =“ 1”在iOS上似乎不起作用。我做错什么了吗?

时间:2019-01-09 17:04:14

标签: angular nativescript

<FlexboxLayout style=“width: 200; background-color: red;“>
   <Label text=“AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA”
       flexShrink=“1" style=“background-color: blue;“></Label>
   <Label text=“BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB”
       flexShrink=“1" style=“background-color: green;“></Label>
   <Label text=“CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC”
       flexShrink=“1" style=“background-color: yellow;“></Label>
</FlexboxLayout>

这应该截断所有3个标签并显示所有标签。它可以在Android上使用,但在iOS标签上不会被截断,在这种情况下,我们只会看到第一个。

我弄错了吗? 是个错误吗? 有使它起作用的技巧吗? (StackLayout / GridLayout / DockLayout不符合我的需求)

tns-core-modules:5.1.1

https://play.nativescript.org/?template=play-ng&id=RR4zDg

https://github.com/NativeScript/NativeScript/issues/6781

1 个答案:

答案 0 :(得分:0)

可以通过添加“ align-items:center;”来绕过该错误。到FlexboxLayout(感谢Manoj)

<FlexboxLayout style="width: 200; background-color: red; align-items: center;">
    <Label text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
        flexShrink="1" style="background-color: blue;"></Label>
    <Label text="BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"
        flexShrink="1" style="background-color: green;"></Label>
    <Label text="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"
        flexShrink="1" style="background-color: yellow;"></Label>
</FlexboxLayout>

您可以在此处关注该问题:https://github.com/NativeScript/NativeScript/issues/6781

相关问题