简体   繁体   中英

Force an EditText to scroll down to a certain spot

How would I make an multi-line EditText with a vertical scroll bar go down to a certain spot? I want to do this inside of the Java code, and I'd prefer to do it with an EditText, but I'd be willing to use a ScrollView if I need to.

The EditText XML:

<EditText
android:id="@+id/theTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:inputType="textAutoCorrect|textMultiLine"
android:scrollbars="vertical"
android:width="0dp" >

您可以尝试从视图中使用scrollTo api。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM