我想在帶有代碼視圖的片段中顯示我的java代碼現(xiàn)在我的問(wèn)題是我的代碼僅用于向下滾動(dòng)但我想滾動(dòng)可能同時(shí)水平和垂直代碼所以現(xiàn)在我該怎么辦?我已經(jīng)嘗試過(guò)嵌套 Horizontalscrollview 和 scrollview,但它不起作用,我的應(yīng)用程序被迷住了。<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;}
添加回答
舉報(bào)
0/150
提交
取消
