tags:

views:

241

answers:

2

Hi all

i am developing an application which has a general text entry form. So while testing on my moto droid, i am facing a strange issue-- when i touch an input field ( which is at lower end of the screen) -- the on screen keyboard pops up and hides the input field. So user have to enter blindly. So is this a sdk issue OR it is particular for droids OR am i doing something wrong???

I have tested this same form on G1, Hero..i see no issues at all. Please help...

Layout xml file -- `

    <TextView android:id="@+id/textmsg" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:text="Some text"
        android:layout_marginTop="10px" android:textColor="#ffffff"
        android:textSize="15px" android:layout_marginLeft="10px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textstreet1" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="15px"
        android:layout_below="@+id/textmsg" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textstreet2" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="2px"
        android:layout_below="@+id/textstreet1" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textcity" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="2px"
        android:layout_below="@+id/textstreet2" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textstate" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="2px"
        android:layout_below="@+id/textcity" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textzip" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="2px"
        android:layout_below="@+id/textstate" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textcrossstreet"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_marginTop="2px" android:layout_below="@+id/textzip"
        android:textColor="#000000" android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

    <EditText android:id="@+id/textdi" android:layout_width="fill_parent"
        android:layout_height="wrap_content" android:layout_marginTop="2px"
        android:layout_below="@+id/textcrossstreet" android:textColor="#000000"
        android:textSize="20px" android:gravity="center_vertical"
        android:layout_marginLeft="10px" android:paddingLeft="5px"
        android:layout_marginRight="10px" />

</RelativeLayout>

`

A: 

I think you want: http://developer.android.com/intl/zh-CN/guide/topics/manifest/activity-element.html#wsoft

You can specify which softinput method your activity uses in your manifest.

Something like <activity android:softInputMode="adjustPan" android:name... /> will make Android try to pan the currently focused input field into view, or you can use adjustResize to have it try to resize the entire layout to fit the keyboard (this requires that your layout has a ListView or a ScrollView that can be resized.

synic
i have tried these too..but again it is not working
mudit
"Not working" is not a good description of the problem.
synic
A: 

Try enclosing your RelativeLayout inside a ScrollView. THen you just scroll up and down to the fileds you want to edit. I do have a problem with right now that Im looking for and answer, the top item is half hidden under the Screen title, but I don think its an issue with what I suggested.

The behaviour your getting is sort of necessary. There may be a phone without a keyboard. I did notice that if you go to landscape, the keyboard goes away. Guess they assume that in Landscape mode, the physical keyboard will be there.

Im new to this environment, so maybe thre are better ways, but this is working for me.

ScCrow

ScCrow