EditText选择锚点丢失

Jef*_*xon 9 android android-edittext

我刚注意到EditText我的应用程序中的所有字段都没有正确显示选择锚点.例如:

没有选择锚点的图像

但是,我期望的是出现正确的锚点,例如:

带选择锚点的图像

EditText我的应用中受影响的典型示例:

<EditText
    android:id="@+id/text_message"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_toLeftOf="@id/button_send"
    android:layout_marginLeft="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:inputType="text|textShortMessage"
    android:layout_marginRight="4dp"
    android:hint="@string/hint_chat_send" />
Run Code Online (Sandbox Code Playgroud)

另请注意,"粘贴"悬停视图在我的应用程序中有一个奇怪的白色边框,但在其他应用程序中它是完全透明的.

我怀疑某种主题问题,因为它影响我的应用程序中的多个屏幕,但我找不到哪些属性可能导致此问题的信息.

UPDATE

所以,我已经花了几太多的时间调试EditText,TextView以及Editor框架类无济于事.一切似乎都按预期运作.

Activity使用以下布局在同一个应用程序中创建了一个新的空白:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">

    <EditText
        android:layout_width="300dp"
        android:layout_height="wrap_content"
        android:hint="test" />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

在我的其他屏幕中,我正在使用AppCompat库及其相关的主题,但在此Activity我将主题和活动改为Activity具有内置材质主题的Android股票:

public class TestActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {

    setTheme(android.R.style.Theme_Material_Light_NoActionBar);
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_test);
}
...
Run Code Online (Sandbox Code Playgroud)

我的理解setTheme是以这种方式调用应该覆盖我的应用程序中的任何可能的自定义styles.xml.不过,我看到了这个:

标记未在模拟器上显示

这里有点不知所措......

Jef*_*xon 1

解决方案是删除android:popupBackground我在主题中设置的内容:

<!-- This will break the text selection popup -->
<item name="android:popupBackground">@color/not_quite_white</item>
Run Code Online (Sandbox Code Playgroud)

我设置了这个尝试将所有Spinner下拉背景主题设置为相同的颜色。无论出于何种原因,它都会干扰文本选择弹出窗口。此外,调用Activity.setTheme显然没有覆盖此属性,导致一些混乱。