0

I have an edit text with custom background. when they keyboard opens - the screen adjust to show the focused edittext, problem is, it cuts my custom background.

what's the best way to show my edit text including his stroked white background when the keyboard opens?

my manifest right now is on adjustPan setting.

attaching images:

full screen with keyboard closed: screen with keyboard closed

full screen with keyboard open (not showing all of the password edittext) screen with keyboard opened

JozeRi
  • 3,219
  • 6
  • 27
  • 45

3 Answers3

0

Add this in your Manifest section .

 <activity 
        android:windowSoftInputMode="stateHidden|adjustPan|adjustNothing"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"

          />

The activity's main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.

IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

try this make you layout like this

 <ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">

 <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:orientation="vertical">
  // add here all your controls
</LinearLayout>

</ScrollView>

and in your manifest file add this your activity

        <activity
        android:name=".SignupActivity"
        android:parentActivityName=".MainActivity"
        android:windowSoftInputMode="stateHidden|adjustResize"
        android:configChanges="keyboardHidden|orientation|screenSize"/>
AskNilesh
  • 67,701
  • 16
  • 123
  • 163
-1

try this:

<activity 
   android:name=".activityname"
   android:windowSoftInputMode="adjustPan|adjustResize" ></activity>
MurugananthamS
  • 2,395
  • 4
  • 20
  • 49