Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – 在ScrollView中的EditText中滚动大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > android: ViewPager and HorizontalScrollVIew11
是否可以滚动到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嵌入到键盘中?像whatsApp,EditText是可滚动的.

解决方法@H_301_9@
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;
                }
            });

并在你的xml文件

<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,请注明来意。