Android - programowe widoki pozycjonowania

Chcę dowiedzieć się, jak programowo pozycjonować widoki w Androidzie. Powiedzmy na przykład, że mamy ten kod XML.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:id="@+id/mainLayout">
<TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="121dp"
    android:layout_marginTop="140dp"
    android:text="Results" /></RelativeLayout>

Jak mogę osiągnąć ten układ programowo w systemie Android? ponieważ chcę mieć losową pozycję mojego widoku tekstowego.

questionAnswers(2)

yourAnswerToTheQuestion