Reputation: 27
I'm working on my first app.
And I was wondering is there an option to to align a text on top of the switch button instead of right or left?
At the moment I can set the text to the right side or the left side of the switch button.
I know the easy way is just to add a text view. But this is really interesting to me:
Upvotes: 1
Views: 2385
Reputation: 2877
You should add textview
above to switch
and keep switch text empty/null
.
For example
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/switchTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Add 3 Beeps" />
<Switch
android:id="@+id/switchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/switchTitle"
android:text="@null" />
</RelativeLayout>
Upvotes: 1