Hi I have Activity which contain 3 view
-RelativeLayout
---TextView 1)
---ScrollView 2)
-----FrameLayout
---------ListView
---------EditText -----------> When I click over here (2) view only pushup
---TextView 3)
I want only 2) which is scrollview should pushup when keyboard open, but right now it push TextView 3) also
I have tried with in menifest
android:windowSoftInputMode="adjustNothing"
or
android:windowSoftInputMode="adjustResize"
or
android:windowSoftInputMode="adjustPan"
but nothing happens, 3) textview also pushes with 2) Scrollview
Opening the soft keyboard reduces the available screen space, it doesnt change the fact that the TextView 3) is at the bottom of the screen.
So, if I understand correctly you want to not display the TextView 3) when you open the keyboard?
If that's so, you could try using this method here to capture the showing/hiding of the soft keyboard and show/hide the Textview.
EDIT
Also try using android:isScrollContainer="false"
on the scrollview with android:windowSoftInputMode="adjustNothing"
or android:windowSoftInputMode="adjustPan"
what you can do is to detect the keyboard if it is showing hide the text view and id not then show it
here is a piece of code
_Your_Text_View.getViewTreeObserver().addOnGlobalLayoutListener(
new OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
Rect r = new Rect();
// r will be populated with the coordinates of your view
// that area still visible.
activityRootView.getWindowVisibleDisplayFrame(r);
heightDiff = activityRootView.getRootView()
.getHeight() - (r.bottom - r.top);
if (heightDiff > 100) { // if more than100 pixels, its
// probably a keyboard...
//here hide your TextView
}else{
//here Show your TextView
}
});
also write that piece of code in you menifest
android:windowSoftInputMode="stateHidden|adjustPan"
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