开发者

How to position the TextView from code?

开发者 https://www.devze.com 2023-01-18 08:32 出处:网络
Is it possible to place the TextView in som开发者_如何学编程e position which I calculate within my code.

Is it possible to place the TextView in som开发者_如何学编程e position which I calculate within my code.

I have the x and y position with me (which i get after the calculation) and I just want to place the TextView in that position.

How can i implement it?

Please Help.

Thanks,

Sen


The below code may help you:

TextView widget = new TextView(screenContext);
widget.setText("Label"+widgetCount);
widget.setLayoutParams(new AbsoluteLayout.LayoutParams(width,height, calculatedX,calculatedY));

This works only when you are using absolute layout, I assume, you are using it.


Yup, I could place TextViews along a curved line. I just used Absolute layouts. I think that was the only possible method.

0

精彩评论

暂无评论...
验证码 换一张
取 消