narimetisaigopi

relative layout example

Jan 14th, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:layout_width="match_parent"
  6. android:layout_height="match_parent"
  7. android:orientation="horizontal"
  8. android:weightSum="3"
  9. tools:context=".MainActivity">
  10.  
  11.  
  12. <TextView
  13. android:layout_width="wrap_content"
  14. android:layout_height="wrap_content"
  15. android:text="Hello A"
  16. android:textSize="20sp"
  17. android:layout_centerInParent="true"
  18. android:layout_weight="1"
  19. android:background="@color/colorPrimary"/>
  20.  
  21. <TextView
  22. android:layout_width="wrap_content"
  23. android:layout_height="wrap_content"
  24. android:text="Hello B"
  25. android:layout_weight="1"
  26. android:textSize="20sp"
  27.  
  28. android:layout_alignParentRight="true"
  29. android:background="@color/colorAccent"/>
  30.  
  31. <TextView
  32. android:layout_width="wrap_content"
  33. android:layout_height="wrap_content"
  34. android:text="Hello C"
  35. android:layout_weight="1"
  36. android:layout_alignParentBottom="true"
  37. android:textSize="20sp"
  38. android:background="#fadada"/>
  39.  
  40.  
  41. </RelativeLayout>
Add Comment
Please, Sign In to add comment