当我测试我的应用程序时,我意识到如果我使用 API <= 16 的设备,则方法 bringToFront()
不起作用!对于小于 16 的 API,我该如何做到这一点?当我触摸一个 View 时,我需要将它带到前面!
对于 API 17 或更高版本,bringToFront()
可以工作。
谢谢
最佳答案
来自documentation :
public void bringToFront () Added in API level 1
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.
关于Android BringToFront() 查看 API <= 16,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33136961/