我外边的FrameLayout是可以左右滚动的,上下滚动,里边给加了个ScrollView ,能上下滚动了,可ScrollView 里的东西不能左右滚动了代码如下。另外求如何做一个4个方向都能滚动的啊。
ScrollView sv=new ScrollView(context);
    
           this.addView(sv, new LinearLayout.LayoutParams(
               LinearLayout.LayoutParams.FILL_PARENT,
               LinearLayout.LayoutParams.WRAP_CONTENT)); 
           mText2 = new TextView(context);
              mText2.setText("aaa");
              mText2.setTextSize(30);
              mText2.setGravity(Gravity.LEFT);
              mText2.setBackgroundColor(mColorArray[position]);
        
              sv.addView(mText2, new LinearLayout.LayoutParams(
                 LinearLayout.LayoutParams.FILL_PARENT,
                 LinearLayout.LayoutParams.WRAP_CONTENT));