关于Android软键盘弹出,会把原来的界面挤上去的问题,这个问题,我记得前面不知道是在这里还是在eoe上看到过此问题,当时没有注意认真看,(真是个坏毛病啊),现在求教各位,但是我发现如果是TableLayout不会出现此类问题,为何,以及如何解决
就是让软键盘出现在Activity最上层,不把我原来的View挤到嘴上面??

解决方案 »

  1.   

    在eoe上找到了个帖子,说是要直接把高度设置死,不用 fill_parent 或者 wrap_content 属性。还有解决办法没?这种设定死的,最是麻烦了~
      

  2.   

    不会啊 虽然我很菜 但是我记得我写在linearlayout里面的 edittext 或者 button  在使用软键盘的时候没有出现你说的这个情况啊,而且我的button还被键盘覆盖了呢
      

  3.   

    在我的印象里,Android似乎默认把键盘覆盖在屏幕上吧?
      

  4.   


    嗯,这个问题其实我有解决的办法了,只要把界面大小写死就可以,可是我现在有点怀疑是OPhone才会出这种问题,或者是OMS的出问题,我现在试试在Android下是否出现类似问题
      

  5.   

    Ophone没试过。
    不过好像Android确实是直接覆盖的吧
      

  6.   


    Android2.1 我也试过了,也会出现这个问题,昨天说不能连续回复了,我就没发上来 解决办法有的,就是直接写死大小,不要用 fill_parent 和 wrap_content ,这个为什么,不清楚,应该是自动默认的界面大小的话,弹出的界面就把自己的界面的位置挤掉了,写定大小就在前面覆盖了···期待指点~
      

  7.   

    你界面底部的那几个按钮是不是用了RelativeLayout来强行定位底部了?那样的肯定是被挤上去了。
    你写到主体里就,虚拟键盘就会盖上去了。
      

  8.   

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent">
    <ScrollView android:id="@+id/Layout_Scroll"
    android:layout_width="fill_parent" android:layout_above="@+id/Layout_LinearButton"
    android:layout_height="80px" android:focusable="false"> <RelativeLayout android:id="@+id/RelativeLayout01"
    android:layout_height="fill_parent" android:layout_width="fill_parent"
    android:focusable="false">
    <TextView android:layout_height="wrap_content" android:id="@+id/TextView16"
    android:layout_toRightOf="@+id/TextView15"
    android:layout_below="@id/TextView_bsRate"
    android:layout_width="wrap_content" android:textSize="12sp"
    android:paddingRight="10px"></TextView>

    </RelativeLayout>
    </ScrollView> <LinearLayout android:layout_height="wrap_content"
    android:orientation="horizontal" android:baselineAlignedChildIndex="1"
    android:gravity="bottom|fill_horizontal" android:layout_width="fill_parent"
    android:layout_gravity="center_vertical"
    android:layout_alignParentBottom="true" android:id="@+id/FXT_Layout_LinearButton">
    <Button android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_weight="1"
     android:layout_gravity="fill" android:gravity="center"
    android:id="@+id/Button_item"></Button>
    <Button android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_weight="1"
    android:layout_gravity="fill" android:gravity="center" android:id="@+id/Button_zst"
    ></Button>
    <Button android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_weight="1"
    android:layout_gravity="center_vertical" android:gravity="center" android:id="@+id/Button_refresh"></Button>
    <Button android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_weight="1"
    android:layout_gravity="center_vertical"
    android:gravity="center" android:id="@+id/Button_keyboard"></Button>
    <Button android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_weight="1"
    android:gravity="center" android:id="@+id/Button_return"
    android:text="返回"></Button> </LinearLayout>
    </RelativeLayout>代码主体就是这样,RelativeLayout中嵌套一个ScrollView和底下一排LinearLayout排的Button , 楼上说的写到主体里,是指去掉LinearLayout么,直接写在最外层RelativeLayout里么?
      

  9.   

    终于解决了,eoe上一高人指点在androidMainfest.xml文件中在此Activity中写入  android:windowSoftInputMode="adjustPan"解决,结贴~! 
      

  10.   

    按照楼上的解决办法,还是挤上去,求高人指点。
    <?xml version="1.0" encoding="utf-8"?>
       <RelativeLayout 
    android:layout_height="fill_parent" 
    android:layout_width="fill_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:paddingBottom="20dip"
    >
        <RelativeLayout 
    android:id="@+id/readinfo" 
    android:layout_height="wrap_content" 
    android:background="#ff006666"
    android:layout_width="fill_parent">
    <TextView 
    android:layout_height="wrap_content" 
    android:textSize="26px" 
    android:id="@+id/sendName" 
    android:layout_width="fill_parent">
    </TextView>
    <TextView 
    android:layout_height="wrap_content" 
    android:id="@+id/sendTime" 
    android:layout_below="@+id/sendName"
    android:layout_width="fill_parent">
    </TextView>
    </RelativeLayout>
    <RelativeLayout
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"
    android:layout_below="@id/readinfo"
    >
    <TextView android:id="@+id/smsContent"  
    android:layout_width="fill_parent"
    android:textSize="20sp" 
    android:layout_height="fill_parent" >
    </TextView>
    </RelativeLayout>
    <RelativeLayout
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent"
    android:layout_alignParentBottom="true">
    <EditText
    android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="输入回复内容"
      android:layout_alignParentLeft="true"
      android:id="@+id/replyCon"
      android:layout_marginRight="70dip"
    androidMainfest.xml中:<activity android:name=".ReadSms" 
    android:windowSoftInputMode="adjustPan"
    ></activity>
      

  11.   


    应该是没有捕捉到焦点,requestFocus()试试
      

  12.   

    android:windowSoftInputMode="adjustPan"
    在manifest里面加入此属性即可
      

  13.   


    如果使用了TabActivity可能需要在这个TabActivity的manifest文件中设置android:windowSoftInputMode="adjustPan"
      

  14.   

    android:windowSoftInputMode="adjustPan"方法还是没解决
      

  15.   

    解决了 设置错Activity了   汗!
      

  16.   

    刚遇到了和LZ同样的问题,郁闷了一下午!现问题已解决!谢LZ....
      

  17.   

    谢谢,问题已解决,但不知道为什么我的另一个Activity不用标记AdjustPan也是标记了的效果呢?
      

  18.   

    谢谢!原来这样!能否那里可以查到所有android:windowSoftInputMode这样的属性!