Reputation: 169
In emulator screen not jumped , But when i rum application on mobile phone the screen Jumped
Here My xml file code
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/main_bg" >
<!-- Logo -->
<RelativeLayout
android:id="@+id/main_tabBar"
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_alignParentTop="true"
>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relativeLayout2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:layout_marginTop="100dip" >
<!-- JOB DESCRIPTION -->
<TextView
android:id="@+id/txt_JOB_DESCRIPTION"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dip"
android:layout_marginTop="20dip"
android:text="@string/job_desc"
android:textColor="#000000"
android:textSize="14dip"
android:textStyle="bold" >
</TextView>
<EditText
android:id="@+id/edit_JOB_DESCRIPTION11"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginRight="20dip"
android:layout_marginTop="10dip"
android:layout_toRightOf="@+id/txt_JOB_DESCRIPTION"
android:background="@android:drawable/editbox_background"
android:maxLines="1"
android:singleLine="true" >
</EditText>
<TextView
android:id="@+id/txt_JDESCRIPTION"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/edit_JOB_DESCRIPTION11"
android:layout_centerInParent="true"
android:layout_marginLeft="45dip"
android:text="@string/job_title"
android:textColor="#4a596e"
android:textSize="12dip" >
</TextView>
<!-- -->
<!-- LOCATION -->
<TextView
android:id="@+id/txt_JOB_LOCATION"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/txt_JDESCRIPTION"
android:layout_marginLeft="20dip"
android:layout_marginTop="40dip"
android:layout_toLeftOf="@+id/btn_SEARCH"
android:text="@string/location"
android:textColor="#000000"
android:textSize="15dip"
android:textStyle="bold" >
</TextView>
<EditText
android:id="@+id/edit_JOB_LOCATION1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/edit_JOB_DESCRIPTION11"
android:layout_below="@+id/txt_JDESCRIPTION"
android:layout_marginRight="20dip"
android:layout_marginTop="30dip"
android:background="@android:drawable/editbox_background"
android:maxLines="1"
android:singleLine="true" >
</EditText>
<TextView
android:id="@+id/txt_JLOCATION"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/edit_JOB_LOCATION1"
android:layout_centerInParent="true"
android:layout_marginLeft="45dip"
android:text="@string/city_state"
android:textColor="#4a596e"
android:textSize="12dip" >
</TextView>
<!-- -->
<!-- JOB ID -->
<!-- -->
<!-- SEARCH BUTTON -->
<Button
android:id="@+id/btn_search1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/txt_JLOCATION"
android:layout_centerInParent="true"
android:layout_marginTop="15dip"
android:background="@drawable/draw"
android:text="@string/search" >
</Button>
<!-- -->
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:gravity="center"
android:layout_above="@+id/adView"
android:orientation="horizontal"
android:weightSum="10"
android:id="@+id/btnParent" >
<Button
android:id="@+id/btn_Login1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/draw"
android:gravity="center"
android:text="@string/login" />
<Button
android:id="@+id/btn_register"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginBottom="5dp"
android:background="@drawable/draw"
android:gravity="center"
android:text="@string/register" />
<!--
<Button
android:id="@+id/btn_lostlogin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:layout_marginBottom="20dp"
android:background="@drawable/draw"
android:gravity="center"
android:text="Lost Login" />
-->
</LinearLayout>
<TextView
android:id="@+id/textView2"
style="flat_detail_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/btnParent"
android:layout_centerHorizontal="true"
android:capitalize="characters"
android:gravity="center_horizontal"
android:text="Login or register"
android:textColor="#000000" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/main_tabBar"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:text="@string/get_started_with"
android:textColor="#000000"
android:textSize="14dip"
android:textStyle="bold" />
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
ads:adUnitId="ca-app-pub-2584288851778590/4570818460"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"/>
</RelativeLayout>
In Emulator when i click on EditText then screen not jumped and in mobile phone button and text view jumped and overlap.
Please suggest me how i can fix this problem
Thanks In Advance
Upvotes: 0
Views: 133
Reputation: 7259
I have no clue frankly as to how your layout should look like, but having made the following changes to your layout, i found things falling a little bit in place.
changes made:
<com.google.ads.AdView android:id="@+id/adView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/btnParent"
ads:adUnitId="ca-app-pub-2584288851778590/4570818460"
ads:adSize="BANNER"
ads:loadAdOnCreate="true"
ads:testDevices="TEST_EMULATOR, TEST_DEVICE_ID"/>
and portions of the linear layout to:
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:gravity="center"
android:layout_above="@+id/adView"
android:orientation="horizontal"
android:weightSum="10"
android:id="@+id/btnParent" >
I hope that helps!
Upvotes: 0
Reputation: 3122
hi deep please follow below step
1) select Activity
2) then select window soft mode from right side pleas scroll it.
3) then select adjustNothing
then you got result
Upvotes: 1
Reputation: 7435
Try Using android:windowSoftInputMode = "adjustResize"
in your manifest file for the activity. Following is a sample activity entry:
<activity
android:name=".ActivityName"
android:label="@string/name"
android:windowSoftInputMode="adjustResize" />
Upvotes: 0