相关疑难解决方法(0)

按钮始终显示在FrameLayout的顶部

我有这样的FrameLayout:

<FrameLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:onClick="changeColor"
        android:text="new button"/>

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="some text"/>

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

问题是按钮显示在顶部,而FrameLayout类概述告诉我们:"子视图是在堆栈中绘制的,最近添加的子项位于顶部".

android android-framelayout

38
推荐指数
2
解决办法
2万
查看次数

标签 统计

android ×1

android-framelayout ×1