Creating an XML layout in android

sSoleFTreadd

New Member
My problem is I can't seem to get my menu layout to work. So far I've tried using LayoutWeight to try to get the ImageButton's to use up a certain amount of space but I cant seem to get it to work and there's a big gap in between where the first two and second two ImageButton's are. Below is a link to a very quick wire frame of what I want the layout to look like and below that is the code I currently have, without the bottom TextView.I'm not really sure if this is specifically a programming question, but I am looking for either useful resources regarding layouts, suggestions on what I should look in to for certain parts of the code or code that will do what I want/something very similar.Any and all help is appreciated, thanks.Quick notes on my quick wireframe - I essentially want the logo to take up 10% of the vertical pixels/screen, the square images to take 35% each row, so 70% overall. and the remaining 20% to be allocated to the TextView at the bottom.
bUm0K.png
\[code\] <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/bg_image" > <ImageView android:id="@+id/imageView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="http://stackoverflow.com/questions/13822564/@drawable/logo_hb" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="100"> <ImageView android:id="@+id/imageButton1" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="right" android:src="http://stackoverflow.com/questions/13822564/@drawable/imagebutton1" android:layout_weight="50" /> <ImageView android:id="@+id/imageButton2" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="left" android:src="http://stackoverflow.com/questions/13822564/@drawable/imagebutton2" android:layout_weight="50" /> </LinearLayout><LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:weightSum="100" > <ImageView android:id="@+id/imageButton3" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="right" android:src="http://stackoverflow.com/questions/13822564/@drawable/imagebutton3" android:layout_weight="50" /> <ImageView android:id="@+id/imageButton4" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="right" android:src="http://stackoverflow.com/questions/13822564/@drawable/imagebutton4" android:layout_weight="50" /> </LinearLayout></LinearLayout>\[/code\]
 
Back
Top