Android Eclipse在特定位置放置文本视图

Android Eclipse在特定位置放置文本视图,android,xml,eclipse,textview,Android,Xml,Eclipse,Textview,我在一个XML文件中创建它,并希望将文本视图放置在特定位置 <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="200dp" android:text="Text" android:textColor="@color/blue" /> 它位于最后一个按钮下面,所以它就

我在一个XML文件中创建它,并希望将文本视图放置在特定位置

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="200dp"
    android:text="Text"
    android:textColor="@color/blue" 
/>


它位于最后一个按钮下面,所以它就在屏幕中央。我希望它位于右侧屏幕的底部。

如果您使用RelativeLayout作为父对象,则很容易

android:layout_alignParentRight
android:layout_alignParentBottom
(请检查大小写,我不在任何可以重复检查的地方)。

如果您要指定每个视图的位置,使用RelativeLayout将是完美的选择。它是Android布局中最灵活的布局

看看这个。它讨论了如何在相对视图中定位视图


我希望你在解决问题时能从中得到一些想法。

好的,但是如果我想要的话,我们可以说,在某个地方的某个中间位置。是否有像素对齐。我已经试过android:layout_margrin=“25dp”之类的东西了。也许是我做错了,或者有其他方法?最好的方法是使用RelativeLayout,然后调整边距,从那里开始移动。你可以做
android:layout\u centerInParent
将其放置在准确的中心,然后使用边距将其从那里移动,等等。好的,谢谢你的帮助。如果有人读到这篇文章,我所做的就是使用android:layoutmarginRight(或类似的东西)=“25dp”(即大小)。只需玩右、左、上、下的数字,直到看起来正确为止。