Scrollable text widgets?

by jski » Thu, 05 Mar 2009 01:32:53 GMT


Sponsored Links
 I'm trying to get scrollable text widgets for a "chat" like app.  One
would be sued to view the chat history, the other would be used to
enter new messages in.  The ONLY way I ever got scrollable text
widgets to work is to use the ScrollView layout and place either a
EditText widget or a TextView widget inside of it. the The following
is my current best guess as how to do this the right way:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget271"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
</Button>
<ScrollView
android:id="@+id/widget278"
android:layout_width="319px"
android:layout_height="171px"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
<TextView
android:id="@+id/TV1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff9999ff">
</TextView>
</ScrollView>
<ScrollView
android:id="@+id/widget281"
android:layout_width="319px"
android:layout_height="196px"
android:layout_below="@+id/widget278"
android:layout_alignParentRight="true"
<EditText
android:id="@+id/ET2"
android:textSize="18sp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</EditText>
</ScrollView>
</RelativeLayout>

--~--~---------~--~----~------------~-------~--~----~



Scrollable text widgets?

by jski » Thu, 05 Mar 2009 01:32:53 GMT


 I'm trying to get scrollable text widgets for a "chat" like app.  One
would be sued to view the chat history, the other would be used to
enter new messages in.  The ONLY way I ever got scrollable text
widgets to work is to use the ScrollView layout and place either a
EditText widget or a TextView widget inside of it. the The following
is my current best guess as how to do this the right way:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget271"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android=" http://schemas.android.com/apk/res/android" ;
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="OK"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
</Button>
<ScrollView
android:id="@+id/widget278"
android:layout_width="319px"
android:layout_height="171px"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
<TextView
android:id="@+id/TV1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ff9999ff">
</TextView>
</ScrollView>
<ScrollView
android:id="@+id/widget281"
android:layout_width="319px"
android:layout_height="196px"
android:layout_below="@+id/widget278"
android:layout_alignParentRight="true"
<EditText
android:id="@+id/ET2"
android:textSize="18sp"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
</EditText>
</ScrollView>
</RelativeLayout>

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


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