Scrollable text widgets?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Scrollable text widgets?

Postby jski » Tue Mar 03, 2009 11:43 pm

I'm trying to get scrollable text widgets for a "chat" like app. One widget would be used 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 following is my current best guess as how to do this the right way. Is there a better way to get scrollable text widgets than to place them in a ScrollView? I tried enabling different scroll properties for the various text widgets but to no avail.

<?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>
jski
Freshman
Freshman
 
Posts: 3
Joined: Fri Feb 27, 2009 12:17 am

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests