0

我希望在弹出软键盘时将整个布局向上移动以显示,但无法看到视图底部的按钮。

AndroidManifest.xml:

    <activity
    android:name="cn.duckr.android.plan.PlanConfirmPaymentActivity"
    android:windowSoftInputMode="adjustPan"
    style="@style/base_activity_style"
    android:theme="@style/confirm_payment_anim_theme" />
4

2 回答 2

0

为确保系统将您的布局调整到可用空间——确保所有布局内容都可访问(即使它可能需要滚动)——使用“adjustResize”。

关联

 android:windowSoftInputMode="adjustResize"
于 2015-07-08T04:01:32.410 回答
0

您可以将除特定按钮之外的整个布局放在 ScrollView 中来实现这一点。

像这样

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
     <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/scrollView5"
        android:fillViewport="true">

            //put your contents here..      
     </ScrollView>

     <ImageButton
           android:id="@+id/ibSample"
           android:layout_width="50dp"
           android:layout_height="50dp"
           android:adjustViewBounds="true"/>

</RelativeLayout>
于 2016-06-08T11:21:47.913 回答