Android的bringToFront()查看API< = 16 [英] Android bringToFront() View API <= 16

查看:458
本文介绍了Android的bringToFront()查看API< = 16的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在测试我的应用程序,我意识到,如果我使用的设备与API< = 16的方法 bringToFront()不起作用!我怎样才能为的API小于16做到这一点?当我触摸一个观点,我需要把它带到面前!
随着API大于或等于17, bringToFront()

When I was testing my app, I realized that if I use a device with API <= 16 the method bringToFront() does not work! How can I do this for APIs less than 16? When I touch a view, I need to bring it to the front! With API 17 or greater, bringToFront() works.

感谢

推荐答案

只需使用的文档,你可以阅读那里(的 http://developer.android.com/reference/android/view/View.html )认为:

Just by using the documentation you can read there (http://developer.android.com/reference/android/view/View.html) that:

在树更改视图的Z顺序,因此这是对其他兄弟姐妹之上
  意见。这种排序的改变可能会影响布局,如果父容器
  采用了顺序相关布局方案(例如,LinearLayout中)。之前
  奇巧这种方法应遵循通过调用requestLayout()和
  无效()在视图的父逼父与重绘
  新的子排序。

Change the view's z order in the tree, so it's on top of other sibling views. This ordering change may affect layout, if the parent container uses an order-dependent layout scheme (e.g., LinearLayout). Prior to KITKAT this method should be followed by calls to requestLayout() and invalidate() on the view's parent to force the parent to redraw with the new child ordering.

所以它早期的API工作,它只是你应该使用它有点不同;)

So it does work on early APIs, it's just that you should use it a little bit differently ;)

这篇关于Android的bringToFront()查看API&LT; = 16的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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