Skip to content Skip to sidebar Skip to footer

View Entire Content Of Scrollview In Eclipse's Graphical Layout

I'm using Eclipse Helios 3.6.2 for Android development and whenever I design a layout in the graphical layout mode (not the XML layout), I can't see the entire content of a ScrollV

Solution 1:

There's no way to scroll the content inside the Android Layout Editor. What you can do, though, is create a new device simulation with a huge height, so you can see what is hidden in the ScrollView.

To do so, go to the dropdown menu below "Editing config" ang choose "Custom..." (top-left corner of the Android Layout Editor). Select one of your preferred resolutions (mine is 3.7in WVGA) and hit "Copy". The copied resolution will appear in the "Custom" group in the bottom of the list.

Choose your new configuration and hit "Edit...". In there, you can select the "Screen Dimension" property and change the value. I created a resolution 2000x480 (portrait). This way, I can see the whole content inside the ScrollView.

Hope it helps.

Solution 2:

Use an included layout for the scrollview.

Move the entire scrollview layout in a separated file (ie: my_scrollview.xml).

<?xml version="1.0" encoding="utf-8"?><ScrollViewxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent" >
    ...
</ScrollView>

The layout editor will then display the entire scrollview.

In the main layout use in place of the scrollview something like:

<include layout="@layout/my_scrollview" />

Solution 3:

There was a button that allow to remove the clipping generated in a scroll view and show all the views that you have inside it.

In later sdk versions the button is removed, and the view mode is triggered if the scroll view is the root element of the view, so my solution when this doesn't happen (because you have a relative layout with some buttons over the view for example) is extracting the scrollview to it's own view, and including it in the original layout with an include tag.

Solution 4:

My quick fix.

In the upper right corner of the graphic layout window you will see a drop down menu that shows what minimum version of android you are creating for. Make sure you have it set to at least android 2.1. I had an app at 1.6 and i had the same issue you have. swapped minimum build platform to 2.1 and it was magic.

Hope this helps.

Solution 5:

If use Relative layout, you can use layout_marginTop negative, like that:

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="-500px" 
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/linearLayout" >

Increase the layout_marginTop to move scrollview.

Post a Comment for "View Entire Content Of Scrollview In Eclipse's Graphical Layout"