I got three TextViews. The first and the third are defined with a not changing Text. The second, the TextView between the first and the third gets the value with an input. How can I set the second TextView between the first and the third in the layout?
<TextView
android:id="@+id/secondtext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/firsttext"
android:layout_above="@+id/thirdtext"
android:layout_alignLeft="@+id/firsttext"
android:layout_alignRight="@+id/thirdtext"
android:background="@drawable/border"
android:scrollbars="vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
That doesn't work!
<TextView
android:id="@+id/secondtext"
android:layout_width="282dp"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/firsttext"
android:layout_below="@+id/firsttext"
android:background="@drawable/border"
android:ellipsize="marquee"
android:lines="4"
android:scrollbars="vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
That also doesn't work
Define a
LinearLayout
withheight="wrap_content"
andwidth="fill_parent"
.You can overcome your problem with two ways. Either add
android:layout_below="@id/TextViewExample"
in your Textviews or useandroid:layout_marginTop="10dip"
Your question is not clear. But try this.. If you are using Relative layout as parent then
to show three textviews in horizontal way.
to show in vertical way..
Try
Make sure to add your left and right TextView first with the fixed width and
and
Too many dependencies, check if you are getting any circular dependency error in xml. As per your requirement, without specifying the spacing and other UI details, a solution: