开发者

LWUIT Scrolling

开发者 https://www.devze.com 2023-04-05 22:39 出处:网络
Here is another question regarding JavaMe and LWUIT. I need to manually scroll TextArea with help of methods or etc. TextArea contains methods responsible only for obtaining current position of scrol

Here is another question regarding JavaMe and LWUIT.

I need to manually scroll TextArea with help of methods or etc. TextArea contains methods responsible only for obtaining current position of scrolling and its enable and disable.

How can I do this?


I solved problem by using inheritance from TextArea and delegation protected methods of scroll开发者_如何学JAVAing (setScrollX and setScrollY accordingly). Thanks to all!


TextArea extends TextField. In the TextField class there is the setCursorPosition method. So my suggestion is to use this method and you loop through the TextArea content until a certain position you desire is reached.


You can use scrollRectToVisible() which is often more convenient than scrollY and adds smooth scrolling animation.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号