我如何动态地设置来看Android中的位置? [英] How can I dynamically set the position of view in Android?
本文介绍了我如何动态地设置来看Android中的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能改变的观点到code中的位置?像改变其X,Y位置。可能吗?请帮助我。
How can I change the position of view through code? Like changing its X, Y position. Is it possible? Please Help Me.
推荐答案
对于低于蜂窝东西(API等级11),你将不得不使用 setLayoutParams(...)
。
For anything below Honeycomb (API Level 11) you'll have to use setLayoutParams(...)
.
如果您可以限制到蜂窝您的支持,最多可以使用 setX的(...)
,塞蒂(...)
, setLeft(...)
,机顶盒(...)
等
If you can limit your support to Honeycomb and up you can use the setX(...)
, setY(...)
, setLeft(...)
, setTop(...)
, etc.
这篇关于我如何动态地设置来看Android中的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文