Wednesday, May 8, 2013

[android help] Android: making a simple layout


I would like to construct a simple table layout in Android BUT I got some problems with it. At part 1: there are some text views so I would like to put that TableRow's height to wrap_content. At part 2: same thing.


It works all still now BUT:


At part 3: there are 2 listview-s and at part 4 there are some buttons. I would like to do something like this: let the part 4's height to wrap content but make the part 3 to fill all the empty space on the screen.


a busy cat


Please give me a solution for this, beacause when i probed the part 3 filled out all the emty space till the bottom of the screen. Now I tryed with weight_sum BUT I do not like it because I would let the 4'd row to wrap_content.



xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/black"
android:weightSum="1.0" >

android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:weightSum="1.0" >

android:id="@+id/phone_tab_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_right_border"
android:gravity="center"
android:singleLine="true"
android:text="Phone Tab"
android:textColor="@android:color/white"
android:textSize="14dp" />

android:id="@+id/pc_tab_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center"
android:singleLine="true"
android:text="PC Tab"
android:textColor="@android:color/white"
android:textSize="14dp" />


android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@layout/style_bottom_border" >

android:id="@+id/phone_path_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_bott_right_border"
android:gravity="center"
android:paddingBottom="5dp"
android:singleLine="true"
android:text="mnt/sdcard/Movies/dpad/sadas/asda/sda/as"
android:textColor="@android:color/white"
android:textSize="8dp" />

android:id="@+id/pc_path_text_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7"
android:gravity="center"
android:paddingBottom="5dp"
android:singleLine="true"
android:text="mnt/sdcard/Movies/dpad/sadas/asda/sda/as"
android:textColor="@android:color/white"
android:textSize="8dp" />


android:id="@+id/tableRow3"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.9"
android:weightSum="1.0" >

android:id="@+id/listview_phone_files"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:background="@layout/style_right_border" />

android:id="@+id/listview_pc_files"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.7" />


android:id="@+id/tableRow4"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.1"
android:background="@layout/style_top_border"
android:gravity="center"
android:weightSum="1.0" >

android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Button" />

android:id="@+id/button_active_tab_changer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.4"
android:background="@android:color/transparent"
android:onClick="changeActiveTabButton"
android:src="@drawable/button_change_tab" />

android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:text="Button" />



.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...