LWUIT Scrolling

梦想与她 提交于 2019-12-11 06:46:00

问题


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 scrolling (setScrollX and setScrollY accordingly). Thanks to all!


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/7484720/lwuit-scrolling

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!