Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8367283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:07:08+00:00 2026-06-09T13:07:08+00:00

My Android app’s main activity looks like this: <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/RelativeLayout1

  • 0

My Android app’s main activity looks like this:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/RelativeLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/ScrollView"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true"
        android:orientation="vertical"
        android:paddingLeft="60dp"
        android:paddingTop="53dp" >

        <RelativeLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/RelativeLayout1"
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/billAmountText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/billAmount_string"
                android:textAppearance="?android:attr/textAppearanceMedium" />

            <EditText
                android:id="@+id/billAmount"
                android:layout_width="173dp"
                android:layout_height="wrap_content"
                android:layout_below="@id/billAmountText"
                android:layout_marginTop="3dp"
                android:inputType="numberDecimal" />
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>

In order to make sure the background image (defined in the first RelativeLayout) does not get squeezed when the keyboard pops up, I have set android:windowSoftInputMode="stateVisible|adjustPan in the manifest file for my activity. All good with the background and layout now, nothing gets resized.

But the problem is that my ScrollView doesn’t work now because I suppose the system thinks the window doesn’t need resizing due to my above modification to the manifest – so the ScrollView is not activated. The opposite happens when I take android:windowSoftInputMode="stateVisible|adjustPan out, the scrolling works, but the background gets squeezed when the keyboard pops out.

Is there any way to code it so that my background doesn’t get squeezed, and my ScrollView still works? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:07:09+00:00Added an answer on June 9, 2026 at 1:07 pm

    Try to use in your activity the property windowSoftInputMode with the following values:

    android:windowSoftInputMode="stateAlwaysHidden|adjustResize"

    I don’t know if it’s necessary but you can try to add to your layout’s ScrollView tag the fillViewPort to true.
    So it should look like something I show you below:

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:fillViewport="true">
    
            <!-- Other Views -->
    </ScrollView>
    

    Let me know about your progress.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my android app crash before load main.xml. This is the exception thrown java.lang.RuntimeException: Unable
My Android app has a layout that looks like this: --------------------- | | |
My Android app having many buttons. My main.xml layout has three buttons. I know
My Android app starts on an activity named LoadingActivity . This activity loads a
import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.Button; import android.widget.RelativeLayout; public class
My Android app looks great at 480x800 pixels resolution but it breaks at LDPI
My android-app gets List in the one activity, but activity,that contains the LisView for
My Android app has a main WebView (HTML loaded from a local resource) which
Every activity within my android app is generated using HTML. When one of the
My Android app has a button that executes this code in order to open

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.