大佬教程收集整理的这篇文章主要介绍了android – 在ScrollView中的EditText中滚动,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <!-- scroll inside this EditText --> <EditText android:id="@+id/et_scrollhere" android:lines="6" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="Voorbeeld" android:layout_margin="5dp" android:scrollbars="vertical" android:inputType="textMultiLine"/> </LinearLayout> </ScrollView>
EditText dwEdit = (EditText) findViewById(R.id.DwEdit); dwEdit.setOnTouchListener(new OnTouchListener() { public Boolean onTouch(View view,MotionEvent event) { // TODO Auto-generated method stub if (view.getId() ==R.id.DwEdit) { view.getParent().requestDisallowInterceptTouchEvent(true); switch (event.getAction()&MotionEvent.ACTION_MASK){ case MotionEvent.ACTION_UP: view.getParent().requestDisallowInterceptTouchEvent(false); break; } } return false; } });
<EditText android:id="@+id/DwEdit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:minLines="10" android:scrollbarStyle="insideInset" android:scrollbars="vertical" android:overScrollmode="always" android:inputType="textCapSentences"> </EditText>
我希望它能帮助你..
以上是大佬教程为你收集整理的android – 在ScrollView中的EditText中滚动全部内容,希望文章能够帮你解决android – 在ScrollView中的EditText中滚动所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。