I am trying to have a TextView to fill the space between a button on the left and the edge of the layout on the right.
<TextView
android:id="@+id/welcomeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/setInfusionReminder"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="Welcome!" />
What I am seeing in the editor however is android:layout_marginRight is applied on the left. The end result is 40dp margin on the left and 0 margin on the right.

It’s the following attributes that don’t quite work together as you’d expect:
Sidenote: Atleast from what I’ve seen in my own projects, it tends to make the element somewhat uncontrollable for further layout-related attributes.
Update to address the comment:
I’d probably do the following:
This should make it expand as much as possible to the right, while centering the content (text).