ScrollView with TextView with HTML inside another scrollView with clickable links, doesn't work

ScrollView with TextView with HTML inside another scrollView with clickable links, does not work

我有一个 scrollView ,现在我需要在这个 scrollView 中有一个小的可滚动 textView 。我能够用下面的代码做到这一点:

 scrollView.setOnTouchListener(new View.OnTouchListener() {

        public boolean onTouch(View v, MotionEvent event)
        {
            findViewById(R.id.childScrollView).getParent().requestDisallowInterceptTouchEvent(false);
            return false;
        }
    });
    childScrollView.setOnTouchListener(new View.OnTouchListener() {

        public boolean onTouch(View v, MotionEvent event)
        {

// Disallow the touch request for parent scroll on touch of
// child view
            v.getParent().requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });

现在 textView 在子滚动视图中滚动。我需要在这个带有可点击链接的 textView 中显示 HTML。现在,一旦我给出 属性

txtView.setMovementMethod(LinkMovementMethod.getInstance())

textView 停止滚动。我需要文本视图中的滚动和可点击链接。

如何更改上面的代码,以便我可以保持 textView 的滚动以及在 textView 上应用 setMovementMethod(LinkMovementMethod.getInstance())

如果可行,请告诉我。

谢谢

因为我找不到解决上述问题的方法。 我通过在 scrollView 中使用 WebView 而不是 TextView 解决了我的问题。

现在要使 webview 在 ScrollView 内滚动,我使用了与之前使用的代码相同的代码,我所做的唯一更改是将 WebView 用作 ChildView 像这样的 ParentScrollView ;

webView.setOnTouchListener(new View.OnTouchListener() {

    public boolean onTouch(View v, MotionEvent event)
    {

// Disallow the touch request for parent scroll on touch of
// child view
        v.getParent().requestDisallowInterceptTouchEvent(true);
        return false;
    }
});

这样我就可以在 scrollView 中滚动 textview(现在在 webview 中)。