LWUIT Scrolling - java-me

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!

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.

Related

Montouch tablview as subview issue

I am new to Xamarin IOS and I have a problem with creating nested layouts in IOS as like in Android(some text controls and a list view) . I added a tableview but not sure how to add some text and image controls in a view and add the tableview below the text and image controls. Also I am using ViewPager in Android and is there an equivalent control that I can use in IOS?
Yes, you should use UIScrollView and enable paggin there. The only issue that you need always to set the ContentSize for it, to make it scroll properly. So you should set the common Size of inner content.
You should check out monotouch.dialog for rapid tableview development. Once you get the hang of it, it makes creating tables a lot easier.

TextArea without Scrollbars

I have a TextArea in my application that actually takes no interactions from the user.
Is there a way to either
Remove the scrollbar entirely and let me handle what happens when the scrollbar would appear?
Use a different object to display text to the screen? I need to be able to append text, but I don't need it to be highlight-able or take any user input.
According to your needs, you need to use label.
If you need TextArea, to remove scrollBars, you can do the next :
Use lookupAll(java.lang.String selector) method to find scrollBars, and
call scrollBar.setOpacity(0.0) for each found scrollBar.
2a. Don't call setVisible(false), as visible property (I believe) is used to TextArea to control scrollBar visibility.

In J2me lWUIT Library how to arrange long text on Label?

I am using LWUIT Library. I want to add same long information of project on AboutUS FORM. I'm using label but information become lost. If I am not using TextArea then what is another Solution?
My Another Question is,
In Login Form, what should be used TextField or TextArea?
Label is not good for showing long information. because its not allow to show multiple lines. Better you can use with TextArea and set the editable mode to false. If you dont want to use TextArea means just start the ticker on the Label.
Use TextField for login page.

inputAccessoryView not hide the view when -resignFirstResponder?

I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
The input accessory view is automatically dismissed with the input view (the keyboard, in this case). Generally you do not want to have an input accessory view in your view hierarchy. Instead, if you want your toolbar to scroll up when the keyboard is shown, you should follow the guidelines for Managing the Keyboard.
You could try using an additional toolbar that is offscreen as the inputAccessoryView, which could "fake" the appearance of what you are trying to do. Alternatively, have you tried adding the toolbar back to the bottom of the screen using
[self.view addSubview:theToolbar];
when the keyboard reaches the bottom of the screen? You can use keyboard notifications for this.

java me textfield

i want to have default text in a textfield which disappears when the textfield gets focus. similar to the google search box in firefox.
also with java me is it possible to set a background image for a display.
The answer of your second question is easy. Unless you use canvas, it is not possible.
AFAIK you cannot handle focus events on a textfield in J2ME so it is not possible.

Resources