Android scrollview inside another scrollview doesn't scroll

后端 未结 9 560
北恋
北恋 2020-12-10 02:36

I\'m trying to put a ScrollView inside another ScrollView and I tried the answers found on this site but it still doesn\'t seems to work completely. Here is the XML:

9条回答
  •  無奈伤痛
    2020-12-10 03:26

    Old Question though, I am posting what worked for me,I understand the issue Coz i have gone through it too, I just removed the ScrollView for TextView in XML, rather implemented scrolling feature for TextView in java code. Thus, XML would be:

        
    
        
           
                
    

    and the Java Code would be

     TextView extViewDD =  
        (TextView)findViewById(R.id.textViewDirectoryDescription);    
        //for Scrolling of textView       
        textViewDD.setMovementMethod(new ScrollingMovementMethod());
    //to stop parent linearlayout scrollview when touched on textview
        textViewDD.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                v.getParent().requestDisallowInterceptTouchEvent(true);
                return false;
            }
        });
    

提交回复
热议问题