I have an application were i am trying to align 3 textViews. These are inside a LinearLayout(vertical orientation) which is placed inside a ScrollView.
If I don't use the ScrollView and the LinearLayout I can have all three aligned to each other as one on the left of the screen, and the other 2 to the right.
But when I use the ScrollView and the LinearLayout I can only align them at the bottom and no longer to the right.
can some help me to align these three text views inside the ScrollView ?
this is the code I am using:
<ScrollView
android:layout_width="fill_parent"
android:layout_height="250dp" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="250dp"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:layout_marginLeft="25dp"
android:text="one"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_marginLeft="25dp"
android:layout_toRightOf="@+id/textView2"
android:text="two"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView3"
android:layout_alignBottom="@+id/textView3"
android:layout_marginLeft="22dp"
android:layout_toRightOf="@+id/textView3"
android:text="three"
android:textAppearance="?android:attr/textAppearanceLarge" />
</LinearLayout>
i need the code to be something like this:
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/scrollView1"
android:layout_marginTop="40dp"
android:text="one"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView2"
android:layout_alignBottom="@+id/textView2"
android:layout_marginLeft="25dp"
android:layout_toRightOf="@+id/textView2"
android:text="two"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textView3"
android:layout_alignBottom="@+id/textView3"
android:layout_marginLeft="22dp"
android:layout_toRightOf="@+id/textView3"
android:text="three"
android:textAppearance="?android:attr/textAppearanceLarge" />