The xmlns attribute needs to move to ScrollView because it always has to be
declared in the first tag after the ?xml tag.  You also need to specify the
layout width and layout height for the ScrollView.

I may be wrong that the xmlns attribute needs to be moved to the
ScrollView... I just always make sure it goes in the first tag out of
habit.  But you definitely need the width and height settings... If you
don't specify them the app will crash.

From:
http://developer.android.com/guide/topics/resources/layout-resource.html
android:layout_height *Dimension or keyword*. *Required*. The height for the
group, as a dimension value (or dimension
resource<http://developer.android.com/guide/topics/resources/more-resources.html#Dimension>)
or a keyword ("fill_parent" or "wrap_content"). See the valid
values<http://developer.android.com/guide/topics/resources/layout-resource.html#layoutvalues>below.
android:layout_width*Dimension or keyword*. *Required*. The width for the
group, as a dimension value (or dimension
resource<http://developer.android.com/guide/topics/resources/more-resources.html#Dimension>)
or a keyword ("fill_parent" or "wrap_content"). See the valid
values<http://developer.android.com/guide/topics/resources/layout-resource.html#layoutvalues>below.
Hope that helps,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Wed, Jul 21, 2010 at 3:39 PM, Amit Sood <sood.is...@gmail.com> wrote:

> Justin,
>
> Thanks for the reply.
>
> I did add the scroll view in the xml but the application is crashing now.
> Please find the updated below and please advice
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>  <ScrollView>
>
> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android";
>     android:orientation="vertical"
>     android:layout_width="fill_parent"
>     android:layout_height="wrap_content"
>     >
>     <TextView
>         android:text="@string/HeaderText"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>     </TextView>
>     <Button
>         android:id="@+id/btnLinear"
>         android:text="@string/Linear_Layout"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>     </Button>
>     <Button
>         android:id="@+id/btnRelative"
>         android:text="@string/Relative_Layout"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>     </Button>
>     <Button
>         android:id="@+id/btnTable"
>         android:text="@string/Table_Layout"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         ></Button>
>     <Button
>         android:id="@+id/btnGrid"
>         android:text="@string/Grid_Layout"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content"
>         ></Button>
>     <Button
>         android:id="@+id/btnTab"
>         android:text="Click me to for tab layout"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         </Button>
>     <Button
>         android:id="@+id/btnList"
>         android:text="Click me for List view"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>     </Button>
>     <ImageView
>     android:src="@drawable/imgbutton"
>     android:layout_width="wrap_content"
>     android:layout_height="wrap_content"></ImageView>
>
>      <ImageButton
>     android:id="@+id/btnImage"
>     android:src="@drawable/imgbutton"
>     android:layout_width="match_parent"
>
>     android:layout_height="wrap_content"></ImageButton>
>      <Button
>         android:id="@+id/btnMenu"
>         android:text="Menu Demos"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>     </Button>
>     <Button
>         android:id="@+id/btnGraphics"
>         android:text="2D Graphics"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         </Button>
>     <Button
>         android:id="@+id/btnUIEvents"
>         android:text="UI Events"
>         android:layout_width="fill_parent"
>         android:layout_height="wrap_content">
>         </Button>
>
> </LinearLayout>
> </ScrollView>
>
> On Thu, Jul 22, 2010 at 2:56 AM, Justin Anderson 
> <janderson....@gmail.com>wrote:
>
>> Wrap the LinearLayout in a ScrollView and take the  following line out of
>> LinearLayout:
>> android:scrollbars="vertical"
>>
>> Not sure if that is the best or recommended way but that is how I did it
>> in my app...
>>
>> ----------------------------------------------------------------------
>> There are only 10 types of people in the world...
>> Those who know binary and those who don't.
>> ----------------------------------------------------------------------
>>
>>
>>
>> On Wed, Jul 21, 2010 at 3:13 PM, Amit Sood <sood.is...@gmail.com> wrote:
>>
>>> Hello Experts,
>>>
>>> I have a linear layout in which i have many buttons. As i m adding
>>> more to it the layout is not bring its scroll so i cannot see my newly
>>> added buttons
>>>
>>> XML for the layout is below.
>>>
>>> Please advice
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>>
>>> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/
>>> android"
>>>    android:orientation="vertical"
>>>    android:layout_width="fill_parent"
>>>    android:scrollbars="vertical"
>>>    android:layout_height="wrap_content"
>>>    >
>>>        <TextView
>>>                android:text="@string/HeaderText"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>        </TextView>
>>>        <Button
>>>                android:id="@+id/btnLinear"
>>>                android:text="@string/Linear_Layout"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>        </Button>
>>>        <Button
>>>                android:id="@+id/btnRelative"
>>>                android:text="@string/Relative_Layout"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>        </Button>
>>>        <Button
>>>                android:id="@+id/btnTable"
>>>                android:text="@string/Table_Layout"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content"
>>>                ></Button>
>>>        <Button
>>>                android:id="@+id/btnGrid"
>>>                android:text="@string/Grid_Layout"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content"
>>>                ></Button>
>>>        <Button
>>>                android:id="@+id/btnTab"
>>>                android:text="Click me to for tab layout"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>                </Button>
>>>        <Button
>>>                android:id="@+id/btnList"
>>>                android:text="Click me for List view"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>        </Button>
>>>        <Button
>>>                android:id="@+id/btnMenu"
>>>                android:text="Menu Demos"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>        </Button>
>>>        <Button
>>>                android:id="@+id/btnGraphics"
>>>                android:text="2D Graphics"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>                </Button>
>>>        <Button
>>>                android:id="@+id/btnUIEvents"
>>>                android:text="UI Events"
>>>                android:layout_width="fill_parent"
>>>                android:layout_height="wrap_content">
>>>                </Button>
>>>          <ImageButton
>>>    android:id="@+id/btnImage"
>>>    android:src="@drawable/imgbutton"
>>>    android:layout_width="fill_parent"
>>>    android:layout_height="wrap_content"></ImageButton>
>>> </LinearLayout>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Android Beginners" group.
>>>
>>> NEW! Try asking and tagging your question on Stack Overflow at
>>> http://stackoverflow.com/questions/tagged/android
>>>
>>> To unsubscribe from this group, send email to
>>> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
>>> For more options, visit this group at
>>> http://groups.google.com/group/android-beginners?hl=en
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google
>> Groups "Android Beginners" group.
>>
>> NEW! Try asking and tagging your question on Stack Overflow at
>> http://stackoverflow.com/questions/tagged/android
>>
>> To unsubscribe from this group, send email to
>> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/android-beginners?hl=en
>>
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to