Reputation: 3182
I want to expand my XML layout as I have a number of buttons I need to put on one screen. I have added a scrollview under my textview and image view but cant seem to get the layout to expand? I'm also getting an XML error layout on my scrollview of:
error: Error parsing XML: mismatched tag
Here's my layout showing the expansion issue. Can anyone gibe me an Idea of what I'm doing wrong?:
Heres my XML - Im aware i have duplicate information. This is a test.:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="84dp"
android:orientation="horizontal" >
<ImageView
android:id="@+id/imgLink"
android:layout_width="60dp"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_weight="0.91"
android:src="@drawable/menulist" />
<TextView
android:id="@+id/textView1"
android:layout_width="165dp"
android:layout_height="match_parent"
android:layout_weight="0.14"
android:gravity="center"
android:text="Menu"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="40sp" />
</LinearLayout>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Button
android:id="@+id/btnAdd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/addconmenu"
android:src="@drawable/addconmenu"
android:text="Contacts List" />
<Button
android:id="@+id/btnView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/todo"
android:src="@drawable/todo"
android:text="'To Do' List" />
<Button
android:id="@+id/btnEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/musicmenu"
android:src="@drawable/musicmenu"
android:text="Music List" />
<Button
android:id="@+id/btnEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/shoppingmenu"
android:src="@drawable/shoppingmenu"
android:text="Shopping List" />
<Button
android:id="@+id/btnEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/gymmenu"
android:src="@drawable/gymmenu"
android:text="Gym List" />
<Button
android:id="@+id/btnEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="20dp"
android:drawableLeft="@drawable/appointmentmenu"
android:src="@drawable/appointmentmenu"
android:text="Appointment List" />
</LinearLayout>
</LinearLayout>
</ScrollView>
Upvotes: 0
Views: 139
Reputation:
The Linear Layout height inside of your ScrollView is wrapcontent if you make it match parent or fillparent it will solve your problem.
Upvotes: 1
Reputation: 234795
It looks like you should reverse the order of the last two lines of your layout. You are closing the ScrollView
tag after closing the top-level LinearLayout
tag.
Upvotes: 3