I have a scroll view and inside that there is a layout out. Inside that layout I have included a form (basically textfields and textviews)
When in the runtime. if I press on a textfield keyboard will be appear which is tottaly normal. But there is a problem background image has been shrinked.
Is there any way to avoid it. Background image shouldn't shrink
you have to change your manifest file
in your activity tag
android:windowSoftInputMode="adjustPan"
add this.
see this http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft
We have to set background onto top-level view added to the Window Manager
Follow 2 steps to resolve this issue:
1.You have to set background into onCreate() method
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().setBackgroundDrawableResource(R.drawable.your_drawable_background);
}
2.Remove background from your xml
android:background="@drawable/your_drawable_background"
Background Shrink with Scroll View Issue would be resolved completely.
Ok I fixed it by using
android:windowSoftInputMode="stateVisible|adjustPan"
entry inside tag in manifest file. That should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With