News ticker with moving text from left to right

后端 未结 2 392
南方客
南方客 2020-12-20 06:59

I am trying to make a rss news ticker which will display the text,the text need move from left to right

I made the the code and text is moving from left to

2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-20 07:51

    You are using hard coded values for the start and max value of x. From your question I think the text in the label has a dynamic length (correct?). If the text is of dynamic length the value of x should also be dynamic.

    Also, x starts at -800. Then slowly grows to 800 and then it gets set to 4. This seems strange to me, if the first run started at -800, the second run may also need to start at -800.

    Hope this somewhat helped you. If not, please provide more details (like why you chose -800, 800 and 4).

提交回复
热议问题