2013-03-21 2 views
0

я использую ниже файл XML в этом XML-файле, когда я нажимаю на EditText клавиатура перекрывает редактировать текстКлавиатура перекрывающихся EditText

XML:

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:layout_weight="1" 
    android:background="@drawable/blue_bg" 

    > 

    <!-- Menu Panel --> 
    <RelativeLayout 
      android:id="@+id/menuPanel" 
      android:layout_height="match_parent" 
      android:layout_width="wrap_content" 
      android:gravity="right" 
      android:background="#52555a" 
      android:orientation="vertical" > 

      <TextView 
       android:id="@+id/menu_title_1" 
       android:layout_width="fill_parent" 
       android:layout_height="50dp" 
       android:layout_alignParentTop="true" 
       android:layout_marginLeft="0dp" 
       android:paddingLeft="15dp"    
       android:gravity="center_vertical" 
       android:background="#353535" 
       android:textColor="@android:color/white" 
       android:text="@string/menu_title">  
      </TextView> 

      <View 
       android:id="@+id/menu_item_divider_1" 
       android:layout_width="fill_parent" 
       android:layout_height="0.5dp" 
       android:layout_marginLeft="0dp" 
       android:layout_marginRight="0dp" 
       android:layout_below="@+id/menu_title_1" 
       android:background="#b5b5b5"/> 

      <ListView 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:layout_below="@+id/menu_item_divider_1" 
       android:dividerHeight="1dp" 
       android:id="@+id/list" 
       ></ListView> 
      </RelativeLayout> 

     <!-- Sliding Panel -->  

     <LinearLayout 
      android:id="@+id/slidingPanel" 
      android:layout_width="fill_parent" 
      android:layout_height="fill_parent" 
      android:background="@drawable/background" 
      android:gravity="left" 
      android:orientation="vertical" > 

      <RelativeLayout 
       android:id="@+id/header" 
       android:layout_width="match_parent" 
       android:layout_height="30dp" 
       android:background="@drawable/file" > 

       <View 
        android:id="@+id/header_vertical_divider_1" 
        android:layout_width="2dp" 
        android:layout_height="fill_parent" 
        android:layout_alignParentTop="true" 
        android:layout_marginLeft="15dp" 
        android:layout_toRightOf="@+id/menuViewButton" 
        android:background="@drawable/engraved_bg" /> 

       <ImageView 
        android:id="@+id/menuViewButton" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_alignParentLeft="true" 
        android:layout_centerVertical="true" 
        android:layout_marginLeft="15dp" 
        android:clickable="true" 
        android:contentDescription="@string/description" 
        android:onClick="slidewindow" 
        android:src="@drawable/icon_menu" 
        android:visibility="visible" /> 

       <ImageView 
          android:id="@+id/logo" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_centerHorizontal="true" 
          android:layout_centerVertical="true" 
          android:src="@drawable/sislogo" 
          /> 

      </RelativeLayout> 

      <View 
       android:id="@+id/dividerHeaderBottom" 
       android:layout_width="fill_parent" 
       android:layout_height="1dp" 
       android:background="#414141" /> 

      <ImageView 
       android:id="@+id/clientlogo" 
       android:layout_width="match_parent" 
       android:layout_height="50dp" 
       android:scaleType="fitXY" /> 

       <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/rounded_edittext" 
     android:layout_marginLeft="20dp" 
     android:layout_marginRight="20dp" 
     android:layout_marginBottom="5dp" 
     android:paddingBottom="15dp" 
     android:layout_marginTop="15dp" 
     android:layout_weight="25" 
     > 

     <EditText 
      android:id="@+id/newuser" 
      style="@style/edittxt1" 
      android:layout_below="@+id/olduser" 
      android:layout_centerHorizontal="true" 
      android:visibility="invisible" 
       > 
       <requestFocus /> 
     </EditText> 

     <EditText 
      android:id="@+id/confirmuser" 
      style="@style/edittxt1" 
      android:layout_below="@+id/newuser" 
      android:layout_centerHorizontal="true" 
      android:visibility="invisible" 
        > 
       <requestFocus /> 
     </EditText> 

     <Button 
      android:id="@+id/changedetails" 
      style="@style/btnstyle" 
      android:layout_below="@+id/confirmuser" 
      android:layout_centerHorizontal="true" 
      android:background="@drawable/button_sytle" 
      android:onClick="usernamepassword" 
      android:text="Enter" 
      android:visibility="visible" 
      android:paddingLeft="20dp" 
      android:paddingRight="20dp" 
      android:layout_marginTop="20dp" 
      /> 

     <Spinner 
      android:id="@+id/manageaccounts" 
      style="@style/spinnerstyle" 
       android:layout_below="@+id/imageView1" 

      /> 

     <EditText 
      android:id="@+id/olduser" 
      style="@style/edittxt1" 
      android:layout_below="@+id/manageaccounts" 
      android:layout_centerHorizontal="true" 
      android:visibility="invisible" 
        > 
       <requestFocus /> 
     </EditText> 

    <ListView 
      android:id="@+id/linkedparents" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/manageaccounts" 
      android:layout_marginLeft="10dp" 
      android:layout_marginRight="10dp" 
      android:layout_marginTop="15dp" 

      android:visibility="invisible" 
      > 
     </ListView> 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="match_parent" 
      android:layout_height="30dp" 
      android:layout_alignParentLeft="true" 
      android:layout_alignParentTop="true" 
      android:background="@drawable/containerheader"></ImageView> 

     <TextView 
      android:id="@+id/textView1" 
       style="@style/mainlbl" 
      android:layout_alignBottom="@+id/imageView1" 
      android:layout_alignLeft="@+id/manageaccounts" 
      android:text="Manage Account(s)" 
      android:layout_marginBottom="5dp" 

      /> 

    </RelativeLayout> 
    <LinearLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:layout_weight="1" 
      android:gravity="bottom"> 

      <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="30dp" 
      android:gravity="bottom" 
      android:background="@drawable/bottom_bar"> 

      <ImageView 
      android:id="@+id/imageView3" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_marginBottom="3dp" 
      android:layout_marginLeft="10dp" 
      android:src="@drawable/hom" 
      android:onClick="HOME" 
      /> 

      <ImageView 
      android:id="@+id/imageView4" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_alignTop="@+id/imageView3" 
      android:layout_marginRight="5dp" 
      android:layout_marginBottom="3dp" 
      android:src="@drawable/logout" 
      android:onClick="Logout" 
      /> 
      </RelativeLayout> 
     </LinearLayout> 
     </LinearLayout> 

</FrameLayout> 

я использую requesfocous для каждый edittext, я хочу edittext, чтобы двигаться вверх, когда я нажимаю на edittext box, как я могу это достичь.

+0

Вы пробовали упоминая андроида: windowSoftInputMode = «adjustResize» в манифесте под тегом деятельности? эта ссылка может помочь http://www.vogella.com/blog/2010/10/25/android-windowsoftinputmode/ –

ответ

4

Установите это свойство для деятельности в манифесте

android:windowSoftInputMode="stateVisible|adjustPan" 

Если работает, пожалуйста, поделитесь он

+0

если у меня есть три текстовых поля, как показать следующую опцию на клавиатуре –

+0

android: imeOptions = "actionNext" установить это свойство для EditText также изучает android docs для android: imeOptions –

+0

работает, но могу ли я держать его в определенном представлении, потому что я изменяю представления в действии –

Смежные вопросы