Reputation: 253
I need and I can't find solution for placing EditText element from center of horizontal line in relative layout? Like android:layout_alignParentRight="true", I would need something like layout_alignParentCenterHorizontal. Is there something like that? thanks for help!
Upvotes: 0
Views: 124
Reputation: 949
I'd create an invisible, minimum width item centered horizontally, and then place my EditText relative to that. Use INVISIBLE instead of GONE for the visibility property for this to work. e.g.
<TextView
android:id="@+id/centerLine"
android:layout_width="1dip"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:visibility="invisible"
/>
<EditText
...
android:layout_toRightOf="@id/centerLine"
...
/>
Upvotes: 1