Problem getting a linearlayout to be scrollable

by Mike Topper » Tue, 25 May 2010 22:33:02 GMT


Sponsored Links
 ey,

I'm having problems with a layout I'm currently working with.
Everything looks fine with it in portrait mode, but when i switch to
landscape, the linearlayout that encompasses the textviews and
edittexts go below the end of the screen and you can't see/edit them.

I tried wrapping that linearlayout in a scrollview, but it didn't seem
to do anything.

below is the xml, i'm trying to wrap that first linear layout in a scrollview.

any help would be greatly appreciated.


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content">


<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/customer_id" />
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<EditText android:id="@+id/customerid_field"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/customer_id"
android:singleLine="true" />
<Button android:id="@+id/customerSelectButton"
android:text="@string/button_get_customers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:bufferType="editable"
/>
</LinearLayout>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/po_number" />
<EditText android:id="@+id/ponumber_field"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/po_number"
android:singleLine="true" />

<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/packet" />
<EditText android:id="@+id/packet_field"
android:layout_width="fill_parent"
android:layout_h



Other Threads

1. How to programmatically use "include" on xml

So I read the xml tricks 2 from developer.android.com, and it worked for me.
But I need to programmatically include 1 xml into another. addview returns

07-12 01:01:18.429: ERROR/AndroidRuntime(267):
java.lang.IllegalStateException: The specified child already has a parent.
You must call removeView() on the child's parent first.
07-12 01:01:18.429: ERROR/AndroidRuntime(267):     at
android.view.ViewGroup.addViewInner(ViewGroup.java:1970)

((ViewGroup) placeHolderProductList).addView(productList,
new LinearLayout.LayoutParams(LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT)) ;

Please help.
Conny

-- 

2. Difference between SQLite on HTC Hero (1.5) and Nexus One (FR72)?

Maybe full SQL would give more clue...

Tom




-- 

3. Perkenalan dengan si #robotijo murmer

4. Selesai update f/w dan rooting gak bisa konek 3

5. Continuously scrolling ListActivity

6. Configuring automated build scripts

7. Selesai update f/w dan rooting gak bisa konek 3