Daniel K.
- Forum posts: 4
May 16, 2012, 5:26:42 PM via Website
May 16, 2012 5:26:42 PM via Website
I'm new to android development, so unsure if this is the best way to do what I want, so feel free to provide suggestions. What I want to do is simply just display some verbose text messages to the screen that will scroll and allow the user to slide up and down vertically so they can view any of the messages.
I've spent the past few days trying everything I can find on Google and I still have yet to get anything working. I have been able to successfully have the text display, append to the previous text, and scroll on its own. The common issue I have seen with my working implementations has been the ability of the user being able to scroll the vertical scroll-bars themselves. I have implemented the object properties in the xml, as well as in code, but neither have worked and I'm assuming it is just a noob mistake or some little thing i'm missing.
I have tried both a TextView as well as an EditText object. I have used them in Scrollviews, by themselves but nothing seems to work. I would prefer to use the EditText with scrollbars, but at this point I am up for anything that works. I am pasting what I have currently using the EditText. I have removed the scrollview below just to start with a simpler base.
If anyone has any ideas for what will solve my issue please let me know. I also have a device on order so I do not have the ability to try on hardware yet, so I am doing this all in the droid emulator. Unsure if that is a problem.
I've spent the past few days trying everything I can find on Google and I still have yet to get anything working. I have been able to successfully have the text display, append to the previous text, and scroll on its own. The common issue I have seen with my working implementations has been the ability of the user being able to scroll the vertical scroll-bars themselves. I have implemented the object properties in the xml, as well as in code, but neither have worked and I'm assuming it is just a noob mistake or some little thing i'm missing.
I have tried both a TextView as well as an EditText object. I have used them in Scrollviews, by themselves but nothing seems to work. I would prefer to use the EditText with scrollbars, but at this point I am up for anything that works. I am pasting what I have currently using the EditText. I have removed the scrollview below just to start with a simpler base.
If anyone has any ideas for what will solve my issue please let me know. I also have a device on order so I do not have the ability to try on hardware yet, so I am doing this all in the droid emulator. Unsure if that is a problem.
1<?xml version="1.0" encoding="utf-8"?>
2<LinearLayout xmlns:android="hxxp://schemas.android.com/apk/res/android"
3 android:layout_width="fill_parent"
4 android:layout_height="fill_parent"
5 android:orientation="vertical" >
6
7 <EditText
8 android:id="@+id/path"
9 android:layout_width="fill_parent"
10 android:layout_height="wrap_content" />
11
12 <org.apache.android.media.CustomVideoView
13 android:id="@+id/custom_videoview"
14 android:layout_width="wrap_content"
15 android:layout_height="wrap_content"
16 android:layout_weight="3.33" />
17
18 <EditText
19 android:id="@+id/MessageText"
20 android:layout_width="match_parent"
21 android:layout_height="wrap_content"
22 android:ems="10"
23 android:inputType="textMultiLine" android:layout_marginTop="100dp" android:scrollbars="vertical" android:fadeScrollbars="false" android:gravity="top" android:maxHeight="100dp" android:textSize="10sp">
24
25 <requestFocus />
26
27 </EditText>
28
29</LinearLayout>
2<LinearLayout xmlns:android="hxxp://schemas.android.com/apk/res/android"
3 android:layout_width="fill_parent"
4 android:layout_height="fill_parent"
5 android:orientation="vertical" >
6
7 <EditText
8 android:id="@+id/path"
9 android:layout_width="fill_parent"
10 android:layout_height="wrap_content" />
11
12 <org.apache.android.media.CustomVideoView
13 android:id="@+id/custom_videoview"
14 android:layout_width="wrap_content"
15 android:layout_height="wrap_content"
16 android:layout_weight="3.33" />
17
18 <EditText
19 android:id="@+id/MessageText"
20 android:layout_width="match_parent"
21 android:layout_height="wrap_content"
22 android:ems="10"
23 android:inputType="textMultiLine" android:layout_marginTop="100dp" android:scrollbars="vertical" android:fadeScrollbars="false" android:gravity="top" android:maxHeight="100dp" android:textSize="10sp">
24
25 <requestFocus />
26
27 </EditText>
28
29</LinearLayout>
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.