I am currently converting an XML layout to java code. I want to replicate exactly what I have but I cannot find several functions to set a View's attribute.\[code\] <TableRow android:layout_width="match_parent" android:weightSum="2"> <TextView android:text="@string/parameters_insensitive_trip" android:layout_width="0dip" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center" /> <Spinner android:id="@+id/insensitiveTripSpinner" android:layout_width="0dip" androidrompt="@string/spinner_insensitive_trip" android:layout_weight="1" android:gravity="center" /> </TableRow>\[/code\]using match_parent never works for setHeight() or setWidth(), using 0dip never works either, and I cannot find anything having to do with the weight of the Views. Does anyone have any ideas?