1

我正在为一项活动开发 UI。在该活动中,我添加了一个滚动视图。在该滚动视图中,我添加了一个线性布局,并且在该线性布局中,我添加了一个编辑文本。现在我想将该编辑文本设置为可滚动的那么怎么可能呢?

4

3 回答 3

3

试试这个代码..

  // For horizontal scroll  
 android:scrollHorizontally="true"  

  //For vertical scroll
 android:scrollbars = "vertical"
于 2013-07-05T14:33:42.200 回答
3

您不能将滚动视图放在滚动视图内

<ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="fill_parent"
        android:layout_height="100dp" >


        <EditText
            android:id="@+id/editText1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK" >

            <requestFocus />
        </EditText>

    </ScrollView>
于 2013-07-05T16:30:28.433 回答
0

XML你可以尝试使用..

<EditText
    android:id ="@+id/editInput"
    android:layout_width ="0dip" 
    android:layout_height ="wrap_content" 
    android:layout_weight ="1" 
    android:inputType="textCapSentences|textMultiLine"
    android:maxLines ="4" 
    android:maxLength ="2000"   />

否则,请按照这些..

于 2013-07-05T16:43:19.910 回答