我想在带有代码视图的片段中显示我的java代码现在我的问题是我的代码仅用于向下滚动但我想滚动可能同时水平和垂直代码所以现在我该怎么办?我已经尝试过嵌套 Horizontalscrollview 和 scrollview,但它不起作用,我的应用程序被迷住了。<ScrollView android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="saiful" /> <thereisnospon.codeview.CodeView android:id="@+id/codeViewId" android:layout_width="match_parent" android:layout_height="match_parent"> </thereisnospon.codeview.CodeView> </LinearLayout></ScrollView>我的java文件是public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_java, container, false); codeView = view.findViewById(R.id.codeViewId); codeView.setTheme(CodeViewTheme.ANDROIDSTUDIO).fillColor(); codeView.showCode(Content.java); return view;}
添加回答
举报
0/150
提交
取消