Posted By


rottendevice on 05/21/11

Tagged


Statistics


Viewed 773 times
Favorited by 0 user(s)

Android Table Layout width problem


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:orientation="vertical"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent"
  6. android:background="#ffffff"
  7. android:stretchColumns="1"
  8. >
  9. <TableRow>
  10. <ImageView
  11. android:id="@+id/test_image"
  12. android:src="@drawable/cr_logo"
  13. android:layout_width="wrap_content"
  14. android:layout_height="wrap_content"
  15. android:scaleType="center"
  16. />
  17. </TableRow>
  18. <TableRow>
  19. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  20. android:textColor="#000000"
  21. android:id="@+id/textview"
  22. android:layout_width="wrap_content"
  23. android:layout_height="wrap_content"
  24. android:textSize="15sp"
  25. android:padding="3dip"
  26. android:text="@string/main_1"
  27. />
  28. </TableRow>
  29. <TableRow>
  30. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  31. android:textColor="#000000"
  32. android:id="@+id/textview"
  33. android:layout_width="wrap_content"
  34. android:layout_height="wrap_content"
  35. android:textSize="15sp"
  36. android:text=""
  37. />
  38. </TableRow>
  39. <TableRow>
  40. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  41. android:textColor="#000000"
  42. android:id="@+id/textview"
  43. android:layout_width="wrap_content"
  44. android:layout_height="wrap_content"
  45. android:textSize="15sp"
  46. android:padding="3dip"
  47. android:text="@string/main_2"
  48. />
  49. </TableRow>
  50. <TableRow>
  51. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  52. android:textColor="#000000"
  53. android:id="@+id/textview"
  54. android:layout_width="wrap_content"
  55. android:layout_height="wrap_content"
  56. android:textSize="15sp"
  57. android:padding="3dip"
  58. android:text="@string/main_3"
  59. />
  60. </TableRow>
  61. <TableRow>
  62. <TextView xmlns:android="http://schemas.android.com/apk/res/android"
  63. android:textColor="#000000"
  64. android:id="@+id/textview"
  65. android:layout_width="wrap_content"
  66. android:layout_height="wrap_content"
  67. android:gravity="right"
  68. android:textSize="15sp"
  69. android:padding="3dip"
  70. android:text="@string/main_4"
  71. />
  72. </TableRow>
  73. <TableRow>
  74. <Button android:id="@+id/button"
  75. android:layout_width="wrap_content"
  76. android:layout_height="wrap_content"
  77. android:paddingLeft="30px"
  78. android:textColor="#ffffff"
  79. android:background="#00b40d"
  80. android:padding="10dip"
  81. android:gravity="center_horizontal|bottom"
  82. android:text="Start"
  83. />
  84. </TableRow>
  85. </TableLayout>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.