2012-04-14 37 views
0

你好,我正在尋找一種方法來讓我的disclamer有一個文本框(所以),所以我想要一個滾動條向上滾動&的方式,因爲文本會有點長,目前我無法將它安裝在盒子中。自定義文本欄

http://img24.imageshack.us/img24/6303/introqm.png 



    <?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     style="@style/LYLBKGRD" > 

    <EditText 
    android:id="@+id/editText1" 
    android:layout_width="300dp" 
    android:layout_height="250dp" 
    android:layout_marginLeft="10dp" 
    android:layout_marginTop="15dp" 
    android:inputType="textMultiLine"> 

    <requestFocus /> 
</EditText> 

謝謝

+1

好了,你有什麼問題嗎? – 2012-04-14 20:21:33

+0

試着在'ScrollView'中包裝你的'EditText'。理解你所問的內容有點困難。 – adneal 2012-04-14 20:23:19

+0

抱歉的人,當我寫了很多文本框中的文字只是減少,但我不能看到這就是爲什麼我想要一個滾動條 – Ravon 2012-04-14 20:33:32

回答

0

嘗試以下...

<EditText 
    android:id="@+id/edit_text" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:singleLine="false" 
    android:maxLines="3" 
    android:scrollbars="vertical"> 
</EditText> 

Android TextView with scrollbars and maxHeight

+0

剛纔非常感謝你 – Ravon 2012-04-14 21:41:27