This is how you can Align Views at The Bottom of The Screen
You know, you have to go to layout_main.xml file (If this is the layout you want to tweak with).
Here we add a LinearLayout Component.
Then place a TextView Component within that liner layout.
Most important note:
- Add android:gravity="bottom" in the LinearLayout Component
- Add android:gravity="center_horizontal" in the TextView Component
You are done!
Here goes your SAMPLE code.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom"
android:orientation="horizontal">
<TextView
android:id="@+id/bottomText"
android:layout_width="match_parent"
android:padding="2dp"
android:textSize="18sp"
android:layout_height="wrap_content"
android:background="@color/cardview_dark_background"
android:textColor="#ffffff"
android:gravity="center_horizontal"
android:text="Welcome to KMDA Mobile App" />
</LinearLayout>
And this YouTUBE video on aligning views at the bottom clears all doubts.
Keep learning!
Comments
Post a Comment