Anchors

Desc

I needed a marquee label in one of my recent project and I didn’t find a good one online, so I decided to create my own marquee label component.

I intended to make it work well on both iOS and Android, still there remains one thing in iOS which I cannot fix. I found that in iOS, when you use View component to wrap child components and don’t explicitly set the parent View component width (e.g. use flex), the parent View component will have the same width as it’s child.

It becomes a problem in this custom component because I use a child View component to wrap Text component in order to make the text expand and show in one line. I set the text containner View component size to be bigger than the Text so that it will not have multiple lines nor have the overflow text replaced by ellipsis. The default value of text container width is 1000, which is usually larger than the actual label width. This results in the problem mentioned above, the wrapper View width becomes 1000 also.