android:用java设置文本字段位置、动态位置

android:用java设置文本字段位置、动态位置,android,position,coordinates,textfield,Android,Position,Coordinates,Textfield,我是android编程新手 如何从.java文件活动设置文本字段的位置?我不想从.xml文件中更改它 我已经试过了: TextView tv = new TextView(this); LayoutParams lp = new LayoutParams( LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); lp.setMargins(left, top, right, bottom); //use ints here tv

我是android编程新手

如何从.java文件活动设置文本字段的位置?我不想从.xml文件中更改它 我已经试过了:

TextView tv = new TextView(this);
LayoutParams lp = new LayoutParams(
    LayoutParams.FILL_PARENT,
    LayoutParams.WRAP_CONTENT);
lp.setMargins(left, top, right, bottom); //use ints here
tv.setLayoutParams(lp);
谢谢
对不起,我的英语很差

请把位置调到哪里?你现在有什么问题?