问题
I have a window (vertical layout) that looks like this:
-Window
-View1
-View2
-ScrollView1
-ScrollView2
-TextArea (contained in the scrollView2)
When I focus in on the textarea the keyboard comes up, but when this happens View1 and View2 scroll up and out of the window. So it looks like this now:
-Window
-ScrollView1
-ScrollView2
-Textarea
-Keyboard
I need these two views to stay put and only have the content inside scrollView1 and scrollView2 ( scrollView2 because it contains the textarea and if it is not in a scrollView the keyboard overlaps the textarea so users can't see what they are typing ). How to stop View1 and View2 from being pushed up? I thought if I made View1 and View2 with a top property of 0 that they would always stay put.
回答1:
have you tried using following in your manifest file
android:windowSoftInputMode="adjustPan"
like this
<activity
android:name="com.example.activity.YourActivity"
android:label="@string/title_activity_subscription_setup"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan" >
</activity>
there are various values like adjustPan, adjustResize etc etc. Try them out to see what works best for your situation.
来源:https://stackoverflow.com/questions/23590078/titanium-view-being-pushed-up-when-keyboard-shows-up