不正确的FrameLayout的在Android 5.0及以上孩子的秩序 [英] Incorrect FrameLayout's childs order on android 5.0 and above

查看:306
本文介绍了不正确的FrameLayout的在Android 5.0及以上孩子的秩序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下面是我的XML布局code:

Here is my XML layout code:

<FrameLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" >

        <Button
            android:id="@+id/btn_test"
            android:layout_width="200dp"
            android:layout_height="200dp"
            android:background="@android:color/black"
            android:minHeight="0dp"
            android:minWidth="0dp" />

        <TextView
            android:id="@+id/tv_test"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center"
            android:background="@android:color/white"
            android:gravity="center"
            android:text="12"
            android:textColor="@android:color/black"
            android:textStyle="bold" />
    </FrameLayout>

正如我所期望的的TextView 将覆盖在按钮,但只工作Android和LT; 5.0。我研究为开发者网站关于的FrameLayout 所有API的变化,但仍没有得到确切的信息。有没有人发现?如何通过XML覆盖的TextView 按钮

As I expected the TextView will overlay on the Button, but it only working on android < 5.0. I research for all API changes about FrameLayout from developer site but still not getting exactly information. Did anyone find that? How to overlay TextView on Button via XML?

推荐答案

最后,我知道的变化。这就是 evelation 。希望这有助于其他。 http://developer.android.com/training/material/shadows-clipping.html

Finally I known the change. That is evelation . Hope this help other. http://developer.android.com/training/material/shadows-clipping.html

这篇关于不正确的FrameLayout的在Android 5.0及以上孩子的秩序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆