java - 安卓 4.0 及更高版本 : Copy/paste/cut panel disappears onLongClick Listener on the EditText

标签 java android android-edittext

我在选项卡中使用 PreferenceActivity 并使用 editText 添加页脚:

 <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:foo="http://schemas.android.com/apk/res/com.assignmentexpert"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="vertical">
  <TableLayout 
    android:id="@+id/tableLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:shrinkColumns="2"
    android:stretchColumns="0"
    >
    <TableRow
          android:id="@+id/tableRow1"
          style="@style/text_row" 
          android:layout_weight="1"
          >
  <com.customitems.CustomEditText
        android:id="@+id/taskText"
        style="@style/custom_edittext"
        android:gravity="top|left"
        android:maxLength="8192"
        android:layout_marginLeft= "25dp"
        android:layout_height="110dp"
        android:imeOptions="actionDone"
        android:layout_weight="1"
        android:layout_width="fill_parent"
        android:scrollbars = "vertical"
        android:layout_marginRight="10dp"
        foo:customFont="Roboto-Regular.ttf"
        android:hint="@string/hint_assignment_task"/>


  </TableRow>
         <TableRow android:layout_height="1px" android:background="#323232">
    <TextView android:layout_span="1" android:layout_height="1px" 
             android:layout_width="fill_parent" android:text="">
     </TextView>
        </TableRow>
  <TableRow
          android:id="@+id/tableRow1"
          style="@style/text_row" 
          android:layout_weight="1"
          >
  <com.customitems.CustomEditText
        android:id="@+id/taskSpecReq"
        style="@style/custom_edittext"
        android:gravity="top|left"
        android:maxLength="8192"
        android:layout_marginLeft= "25dp"
        android:layout_height="110dp"
        android:imeOptions="actionDone"
        android:layout_weight="1"
        android:layout_width="fill_parent"
        android:scrollbars = "vertical"
        android:layout_marginRight="10dp"
        foo:customFont="Roboto-Regular.ttf"
        android:hint="@string/hint_assignment_specific_requirements"/>

     </TableRow>

  </TableLayout>

 </LinearLayout>

因此,当我在 taskTest EditText 上使用 LongClick 时,会出现复制/粘贴/剪切并正常工作。但是,当我长按 taskSpecReq 时,我的 taskSpecReq Copy/paste/cut 面板和 Tabs 从屏幕上消失了。 taskSpecReq 位于屏幕底部。

长按第一个 EditText : enter image description here

长按第二个EditText: enter image description here

最佳答案

由于我在其中使用了 TabHost 和嵌套的 Activity,因此我通过使用

解决了它
  android:windowSoftInputMode="stateUnspecified" 

对于 TabActivity 和嵌套 Activity :

  android:windowSoftInputMode = "adjustResize"

它解决了我的问题。

关于java - 安卓 4.0 及更高版本 : Copy/paste/cut panel disappears onLongClick Listener on the EditText,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24454315/

相关文章:

php - 更新功能在 Android Studio 中不起作用

Android EditText 最大长度

java - 未找到值或 ??当插入mysql时

java - 覆盖 Android 中的上下文菜单颜色

java - 已弃用的 Java HttpClient - 有多难?

android - android.graphics.BitmapFactory.nativeDecodeStream( native 方法)中的致命异常 : main java. lang.OutOfMemoryError

android - 为什么将 ImageButton 添加到可选择的 ListView 项会使 ListView 不可选择,而常规 Button 则不会?

android - 如何在 EditText 中输入数字时自动添加千位分隔符

Java:为自定义数组列表的每个类别添加两个随机数组元素

android - firebaseUI 所有共享元素都需要唯一的 transitionNames