Reputation: 585
I have a layout in an app with parallax effect on an edittext, my problem is **when I tap on the edittext softkeyboard hides my editext?**Can anybody please help me for this, I have searched for it and found about "WindowsoftInputmode" which is not working in my case.
Code in manifest
<activity
android:name="one.tusk.stush.activities.NewPostDetailActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|adjustPan" >
Upvotes: 2
Views: 1799
Reputation: 440
Try this in your manifest,
<activity
android:name=".rapcalsy.MainActivity"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Change your layout according this, dont miss the line which is
android:isScrollContainer="true"
<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:isScrollContainer="true"
android:orientation="vertical">
<TableLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="#000000"
android:padding="0dp"
android:stretchColumns="*">
...
</TableLayout>
</ScrollView>
Upvotes: 3
Reputation: 910
I tried a bit with as you said then i got this working edit the your manifest file
<activity
android:name="one.tusk.stush.activities.NewPostDetailActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible" >
and then add below line of code in oncreate of java class
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
So that keyboard will not shown to you directly/always
Upvotes: 2
Reputation: 33
Please try this out.
Set an android:softInputMode attribute to adjustResize in Manifest and put the parent layout inside a ScrollView. Hope this helps.
Upvotes: 2
Reputation: 901
You should only use android:windowSoftInputMode="adjustResize"
.
If this is not enough, you might need to add the property android:fitsSystemWindows="true"
to the root layout containing your EditText.
Upvotes: 4