0

I'm creating an emulator for Android and would like to use the edittext widget to display output from the session and accept input from the user. I've placed the edittext inside of a LinearLayout and have it filling the full screen of the device. I'd like to have it display 80x24 characters at all times (no scrolling). Can anyone suggest a way to do this?

Here is what my XML looks like now:

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

<EditText
    android:id="@+id/editText1"
    android:layout_width="match_parent"
    android:layout_height="fill_parent"
    android:inputType="textMultiLine" 
    android:gravity="top" >

    <requestFocus />
</EditText>

</LinearLayout>

Thanks in advance. Zamil

2 Answers2

0

use these attributes:

android:minLines="X"
android:maxLength="80*X"

hope this helps!

Pratik Bhat
  • 5,493
  • 2
  • 30
  • 50
  • Sorry, this approach doesn't work. It doesn't respect the minLines argument. 24 rows scroll down. maxLength works to limit overall character but how does it limit 80 characters in a row. – user1137939 Jan 09 '12 at 20:49
0

How to adjust text font size to fit textview

I extended upon the answer to the above question. Hope this helps anyone else in the future.

Community
  • 1
  • 1