[英]Scrolling Both horizontally and vertically . how can i show my java code in a code view and scroll my code both horizontally and vertically?
I want to show my java code in a fragment with a code view now my problem is that my code perform only for scrolling down but i want to scroll may code horizontally and vertically at the same time so now what can i do? 我想用代码视图在片段中显示我的Java代码,现在的问题是我的代码仅用于向下滚动,但是我想同时滚动才能水平和垂直编写代码,所以现在我该怎么办?
i already tried by nesting horizontalscrollview and scrollview but it dose not working and my app gone crush. 我已经通过嵌套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>
and my java file is 我的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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.