我使用下面的布局。我在edittext视图上遇到键盘隐藏问题。它隐藏了一半的edittext.i已经在androidmanifest中使用了adjustpan来进行活动,但无法解决问题。如果有人知道有关此问题的任何解决方案,请告诉我。
<i>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ScrollView
android:id="@+id/scrollviewid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="0dp" >
<RelativeLayout
android:id="@+id/layoutone"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="@dimen/padding_left_right"
android:layout_marginRight="@dimen/padding_left_right" >
<RelativeLayout
android:id="@+id/layoutonechild"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/top_margin" >
<TextView
android:id="@+id/textviewone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:paddingRight="@dimen/left_margin"
android:text="@string/str_takeviewone"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
custom:fontAssetName="@string/font_roboto_light" />
<TextView
android:id="@+id/textviewsecond"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/top_margin"
android:layout_toLeftOf="@+id/select_view_btn"
android:layout_toRightOf="@+id/textviewone"
android:gravity="center"
android:textColor="@color/White"
android:textSize="12sp"
custom:fontAssetName="@string/font_roboto_light" />
<ImageView
android:id="@+id/image_view_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/button_button_06_arrow_down"
android:onClick="onclickimagetakebtn" />
</RelativeLayout>
<include
android:id="@+id/includelayoutone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/layoutonechild"
android:layout_centerHorizontal="true"
layout="@layout/payment_error_layout" />
<LinearLayout
android:id="@+id/linearlayoutone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/includelayoutone"
android:layout_marginBottom="0dp"
android:layout_marginTop="@dimen/top_double_margin"
android:orientation="horizontal" >
<com.xxx.CoverFlow
android:id="@+id/carousel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" />
</LinearLayout>
<RelativeLayout
android:id="@+id/layout_amount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearlayoutone"
android:layout_marginTop="0dp"
android:background="@color/tabstrip"
android:visibility="invisible" >
<RelativeLayout
android:id="@+id/rellayout_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/field_output_methods" >
<TextView
android:id="@+id/amounttypeid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_amount"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
/>
<TextView
android:id="@+id/amounttypetextid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/amounttypeid"
android:text="@string/str_amount"
android:textColor="@color/White"
android:textSize="12sp"
android:textStyle="bold"
android:visibility="visible"
/>
</RelativeLayout>
<EditText
android:id="@+id/amountId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="@+id/rellayout_amount"
android:layout_marginLeft="@dimen/margin_half_negative"
android:layout_toRightOf="@+id/rellayout_amount"
android:background="@drawable/username_password"
android:digits="0123456789."
android:ems="10"
android:paddingLeft="10dp"
android:gravity="right|center"
android:hapticFeedbackEnabled="true"
android:imeOptions="actionGo"
android:inputType="phone"
android:paddingRight="@dimen/padding_right_screen"
android:singleLine="true"
android:textColor="@color/white_gray"
android:textSize="12sp" >
</EditText>
</RelativeLayout>
<RelativeLayout
android:id="@+id/relatvivechildtwo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout_amount"
android:layout_marginTop="@dimen/top_margin"
android:visibility="gone" >
<TextView
android:id="@+id/textviewfour"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/field_output_07_paym_methods"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_sendmoneyto"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
/>
<TextView
android:id="@+id/textviewfive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/top_margin"
android:layout_toLeftOf="@+id/select_view_btn"
android:layout_toRightOf="@+id/textviewfour"
android:gravity="center"
android:textColor="@color/White"
android:textSize="12sp"
/>
<ImageView
android:id="@+id/send_view_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:background="@drawable/button_button_06_arrow_down"
android:onClick="onClicksendViewBtn" />
</RelativeLayout>
<LinearLayout
android:id="@+id/linearlayoutchildtwo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/relatvivechildtwo"
android:layout_marginBottom="1dp"
android:layout_marginTop="@dimen/top_double_margin"
android:orientation="horizontal"
android:visibility="invisible" >
<com.xxx.CoverFlow
android:id="@+id/sendcarousel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true" />
</LinearLayout>
<RelativeLayout
android:id="@+id/layout_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearlayoutchildtwo"
android:layout_marginTop="1dp"
android:background="@color/loyalty_tabstrip"
android:visibility="invisible" >
<TextView
android:id="@+id/datetextid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/field_output_methods"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_date"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
/>
<EditText
android:id="@+id/dateId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="@+id/datetextid"
android:layout_marginLeft="@dimen/margin_half_negative"
android:layout_toRightOf="@+id/datetextid"
android:background="@drawable/username_password"
android:editable="false"
android:ems="10"
android:gravity="right|center"
android:inputType="text|textNoSuggestions"
android:maxLength="50"
android:paddingRight="@dimen/padding_right_screen"
android:singleLine="true"
android:textColor="@color/white_gray"
android:textSize="12sp" >
</EditText>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_decs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout_date"
android:layout_marginTop="@dimen/top_margin"
android:background="@color/tabstrip"
android:visibility="invisible" >
<TextView
android:id="@+id/descid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:background="@drawable/field_output_methods"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_desc"
android:textColor="@color/White"
android:visibility="visible"
/>
<EditText
android:id="@+id/descId"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="@+id/descid"
android:layout_marginLeft="@dimen/margin_half_negative"
android:layout_toRightOf="@+id/descid"
android:background="@drawable/username_password"
android:ems="10"
android:paddingLeft="10dp"
android:hapticFeedbackEnabled="true"
android:gravity="right|center"
android:imeOptions="actionGo"
android:inputType="text|textNoSuggestions"
android:maxLength="50"
android:paddingRight="@dimen/padding_right_screen"
android:singleLine="true"
android:textColor="@color/white_gray"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_dummy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout_decs"
android:layout_marginBottom="@dimen/top_double_margin"
android:layout_marginTop="@dimen/top_margin"
android:background="@color/tabstrip"
android:visibility="invisible" >
<TextView
android:id="@+id/dateid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="@dimen/left_margin"
android:background="@drawable/field_output_07_paym_methods"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_desc"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_dummy1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/layout_dummy"
android:layout_marginBottom="@dimen/top_double_margin"
android:layout_marginTop="@dimen/top_margin"
android:background="@color/loyalty_tabstrip"
android:visibility="invisible" >
<TextView
android:id="@+id/dummytext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="@dimen/left_margin"
android:background="@drawable/field_outpu_paym_methods"
android:contentDescription="image"
android:focusable="false"
android:gravity="left|center"
android:paddingLeft="@dimen/left_margin"
android:text="@string/str_desc"
android:textColor="@color/White"
android:textSize="12sp"
android:visibility="visible"
/>
</RelativeLayout>
</RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="@+id/child_two"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@color/brown"
android:layout_weight="1.0" >
<Button
android:id="@+id/btnProc"
style="@style/ButtonSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="@dimen/bottom_margin"
android:layout_marginRight="@dimen/right_margin"
android:layout_marginTop="@dimen/top_margin"
android:background="@drawable/button_disable"
android:onClick="onBtn"
android:text="@string/str_prc"
android:textColor="@color/White"
/>
</RelativeLayout>
</RelativeLayout> </i>
答案 0 :(得分:0)
我认为你应该使用
<activity android:windowSoftInputMode="adjustResize" />
//或者使用两个组合,比如
android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >
在AndroidManifest文件中了解更多信息,请查看活动的windowSoftInputMode属性