I have a ScrollView
inside which is an EditText
which is set to scroll vertically. But it does not scrolls. Instead the whole layout scrolls, Whenever i try to scroll the EditText
.
Below is the code -
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/b1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="39dp"
android:text="Title"
android:textColor="#3bb9ff"
android:textSize="15sp" />
<EditText
android:id="@+id/Text1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ems="10"
android:hint="Title"
android:singleLine="true" >
<requestFocus />
</EditText>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Content"
android:layout_marginTop="50dp"
android:textColor="#3bb9ff"
android:textSize="15sp"
/>
<EditText
android:id="@+id/newTodoText"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:minLines="2"
android:maxLines="7"
android:hint="Write something"
android:scrollbars = "vertical" >
</EditText>
<Button
android:id="@+id/Add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Add" />
</LinearLayout>
</ScrollView>
The EditText with id "newTodoText" is in question here.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…