Guest User

How can I prevent views from overlapping in relative layout

a guest
Mar 30th, 2012
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. <RelativeLayout android:layout_width="wrap_content" android:id="@+id/relativeLayout" android:layout_height="wrap_content">
  2.  
  3. <TextView android:text="TextView" android:id="@+id/name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10sp" android:textStyle="bold" android:textSize="16sp"></TextView>
  4. <TextView android:layout_width="wrap_content" android:id="@+id/address" android:text="address" android:layout_height="wrap_content" android:layout_below="@+id/name" android:layout_alignLeft="@+id/name" android:layout_marginLeft="30sp"></TextView>
  5. <TextView android:layout_width="wrap_content" android:layout_toRightOf="@+id/address" android:text="" android:layout_height="wrap_content" android:layout_alignTop="@+id/address" android:layout_alignBottom="@+id/address" android:id="@+id/crossStreet"></TextView>
  6. <TextView android:layout_width="wrap_content" android:id="@+id/time" android:text="Time" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_marginRight="10sp"></TextView>
  7.  
  8. </RelativeLayout>
  9.  
  10. <?xml version="1.0" encoding="utf-8"?>
  11. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  12. android:layout_width="fill_parent" android:layout_height="wrap_content"
  13. android:orientation="horizontal">
  14. <LinearLayout android:layout_width="fill_parent"
  15. android:weightSum="1.0" android:id="@+id/relativeLayout"
  16. android:layout_height="wrap_content">
  17. <TextView android:text="TextView1 hhhhh hhhhhhhh hhhhhhhh hhhhhhh hhhhhh"
  18. android:id="@+id/name" android:layout_weight="0.5"
  19. android:layout_width="0dip" android:layout_height="wrap_content"
  20. android:layout_marginLeft="10sp" android:textStyle="bold"
  21. android:textSize="16sp"></TextView>
  22. <TextView android:layout_width="0dip" android:layout_weight="0.5"
  23. android:id="@+id/time" android:text="Textview4"
  24. android:layout_height="wrap_content" android:layout_alignParentRight="true"
  25. android:layout_marginRight="10sp"></TextView>
  26. </LinearLayout>
  27. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment