我在选项卡中使用 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 :
长按第二个EditText:
最佳答案
由于我在其中使用了 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/