November 30th, 2012, 05:36 AM
|
#1 (permalink)
|
|
New Member
Thread Author (OP)
Join Date: Nov 2012
Posts: 2
Device(s):
Carrier: Not Provided
Thanks: 0
Thanked 0 Times in 0 Posts
|
a problam with TableRow height
I have a tablelayout and i want the second row to be 15% of the height and the first row to be 85% of the height, so i use weights and it's work just fine.
But when i put ImageButton on the second row the height of the second row becomes bigger then it was before. The height of the imageButton is no more then the 15% of the total height so i don`t understand why it happenes.
Here is my xml code:
Code:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:weightSum="100" >
<TableRow
android:id="@+id/tableRow1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="85" >
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="15" >
<ImageButton
android:id="@+id/ibTakePic"
android:layout_width="75dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:src="@drawable/profile" />
</TableRow>
</TableLayout>
|
|
|