i want to move a seekbar 20dip margin left from center.
android:progressDrawable="@drawable/progress_vertical"
android:thumb="@drawable/seek_thumb" android:layout_height="80dip"
android:layout_width="20dip" android:layout_marginBottom="50dip"
android:layout_alignParentBottom="true" android:visibility="gone"
android:layout_centerHorizontal="true" android:layout_marginLeft="20dip" />
but the above xml code shows it center only.
I made a workaround with a TextView in the middle that has no content (and is not visible).
<TextView
android:id="@+id/viewMiddleInvisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/btnAtTheTop"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp" />
<TextView
android:id="@+id/tvAtLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@id/viewMiddleInvisible"
android:layout_marginRight="10dp"
android:layout_toLeftOf="@id/viewMiddleInvisible"
android:text="Some text" />
You would obviously have to replace tvAtLeft with whatever you want. Same principle if you want to have something to the right of the center.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With