提升子级时Android FrameLayout z索引问题

提升子级时Android FrameLayout z索引问题,android,android-layout,android-view,android-framelayout,Android,Android Layout,Android View,Android Framelayout,我有以下Android XML布局文件: <FrameLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/AutoComplete_marginSides" android:layout_marginRight="@dimen/AutoComple

我有以下Android XML布局文件:

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginEnd="@dimen/AutoComplete_marginSides"
        android:layout_marginRight="@dimen/AutoComplete_marginSides"
        android:layout_marginTop="@dimen/AutoComplete_marginTopBottom"
        android:layout_marginBottom="@dimen/AutoComplete_marginTopBottom"
        android:layout_marginLeft="@dimen/AutoComplete_marginSides"
        android:layout_marginStart="@dimen/AutoComplete_marginSides"
        android:id="@+id/autoCompleteLayout" >

        <MyPackage.maps.DelayAutoCompleteTextView
            android:id="@+id/geoAutoComplete"
            android:layout_margin="@dimen/AutoCompleteTextView_layoutMargin"
            android:layout_width="match_parent"
            android:layout_height="@dimen/AutoCompleteTextView_height"
            android:layout_gravity="center"
            android:gravity="start|center_vertical"
            android:inputType="textCapSentences"
            android:background="@color/white"
            android:paddingLeft="@dimen/AutoCompleteTextView_padding"
            android:paddingRight="@dimen/AutoCompleteTextView_padding"
            android:dropDownWidth="fill_parent"
            android:textSize="@dimen/AutoCompleteTextView_fontSize"
            android:hint="@string/search_map"
            android:elevation="2dp"
            android:singleLine="true"
            android:maxLength="30"/>

        <ImageView
            android:id="@+id/geoAutoCompleteClear"
            android:layout_gravity="center_vertical|end"
            android:contentDescription="@string/search_map_clear"
            android:layout_marginEnd="@dimen/AutoCompleteTextView_clearIconMargins"
            android:layout_marginRight="@dimen/AutoCompleteTextView_clearIconMargins"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_clear"/>

    </FrameLayout>

FrameLayout
布局位于
RelativeLayout
的内部(上面我没有显示)。这个
FrameLayout
只是一个文本视图,末尾有一个十字以删除文本

问题是,当我将
android:elevation
添加到
TextView
时,
ImageView
位于
TextView
之后,尽管不应该,因为我在
TextView
之后定义了它。据我所知,子序列决定了组件的显示方式。但是当我从
TextView
中删除
elevation
时,
ImageView
会正确显示


我是不是错过了什么?原因是什么?

android:elevation
覆盖了框架布局或相对布局中z索引的典型概念。你所看到的是正确的行为。您可以将ImageView的高程设置为“3dp”,这将为您提供预期的顺序

是否可以在没有阴影的情况下设置
高程
@克林森