views:

499

answers:

3

Is there a way to make the screen scroll to allow the text field to be scene?

+1  A: 

I believe that you can make it scroll by using the trackball, which might be achieved programmatically through selection methods eventually, but it's just an idea. I know that the trackball method typically works, but as for the exact way to do this and make it work from code, I do not sure.
Hope that helps.

Luis Miguel
What I think I need is for a way to make the window "artificially" longer so that the view can scroll. Currently the RelativeLayoutis set to android:layout_width="wrap_content" android:layout_height="wrap_content"
Alexis K
I do not know of a solution then. Perhaps you might want to manually adjust the width and height values to suit your needs, by stretching them further to that which "wrap_content" is resolving to.
Luis Miguel
A: 

Are you asking how to control what is visible when the soft keyboard opens? You might want to play with the windowSoftInputMode. See developer docs for more discussion.

Mayra
+2  A: 

Why not try to add a ScrollView to wrap whatever it is you want to scroll. Here is how I have done it, where I actually leave a header on top which does not scroll, while the dialog widgets (in particular the EditTexts) scroll when you open soft keypad.

<LinearLayout android:id="@+id/HeaderLayout" >
  <!-- Here add a header or whatever will not be scrolled. -->
</LinearLayout>
<ScrollView android:id="@+id/MainForm" >
  <!-- Here add your edittexts or whatever will scroll. -->
</LinearLayout>

I would typically have a LinearLayout inside the ScrollView, but that is up to you. Also, setting Scrollbar style to outsideInset helps, at least on my devices.

zmilojko