ngrashia
ngrashia

Reputation: 9904

How to view all widgets in the XML Layout in Graphical view / How to Scroll the Graphical Layout in eclipse?

I have an XML Layout which contains a number of textViews and editTexts one below the other say, 10 textViews and 10 editTexts. This automatically creates a scrollview in mobile phone and emulator. Whereas, in the graphical Layout of ADT, only 4 are visible. I am unable to view the remaining in eclipse Graphical Layout. I have to connect to the emulator to view if the design/alignment is as expected.

Is there any way where I can view all the textViews and editTexts till the last one using the graphical layout feature of eclipse?

Upvotes: 1

Views: 245

Answers (1)

Naveen Kumar
Naveen Kumar

Reputation: 3818

I put whole child View in a Scroll View instead Linear Layout or Relative Layout. Like this

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background_color"
    android:orientation="vertical" >
   ..........
   .......... 

</LinearLayout>
</ScrollView>

This is working for me.

Upvotes: 1

Related Questions