So I have this TextView
in android/java that I would like to position randomly along the horizontal axis where it is located. This is the code I have so far:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<View
android:layout_width="100dp" //This is the width I want to randomize
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/n5"/>
My goal is that, by randomizing the 100dp
in the android:layout_width=
line, I can move my TextView
over by a certain random amount. Would anyone know how to do this?
Thanks!