• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Implement Scrollview based on screen size

Hi All,

I am building an android app that involves the use of scroll view and linear layout.I have implemented it and is working fine for all the screen sizes.But the thing is that if the screen size is big enough to accommodate the contents then the scroll view should not be be working.Instead the things should be displayed normally without the scrolling effect.Is there any way to achieve this effect.

Regards,
Aayush Kumar
 
Hi All,

I am building an android app that involves the use of scroll view and linear layout.I have implemented it and is working fine for all the screen sizes.But the thing is that if the screen size is big enough to accommodate the contents then the scroll view should not be be working.Instead the things should be displayed normally without the scrolling effect.Is there any way to achieve this effect.

Regards,
Aayush Kumar
You should code in XML file like this,
Code:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="fill_parent"
     android:layout_height="fill_parent"
     android:fillViewport="true"
     android:scrollbars = "vertical"
     android:scrollbarStyle="insideInset"
    >
    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:stretchColumns="1"
        >
        <!-- Add here which you want -->
    </RelativeLayout>

</ScrollView>
 
Back
Top Bottom