android中bringToFront的用法,该怎么解决

android中bringToFront的用法
我想把linearlayout布局中的button放大并保持在最上方(z轴),但是使用bringToFront方法后,button的位置却改变了。
该方法的介绍是: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 android.os.Build.VERSION_CODES.KITKAT this method should be followed by calls to requestLayout() and View.invalidate() on the view's parent to force the parent to redraw with the new child ordering.
但是不知道具体该怎么操作。。
------解决方案--------------------
如果你的button是在LinearLayout中,使用bringToFront后,Layout的布局会发生改变。
------解决方案--------------------
引用:
还是不行android中bringToFront的用法,该怎么解决

你可以再试试那2个函数,换个用法调用对象什么的,如果还不行,有2个思路你可以考虑一下:
1、检查animation, 是否setfillafter,是否在监听到动画结束后cancel掉了动画
2、不使用bringtofront改变Z轴顺序, 在布局中把button最后添加进去, 这样button在最上方