我是 Android 新手,所以请帮助我。 在 onDraw 方法中我画了很多东西,我想把它们作为背景。当我点击角落时,我想要 ListView (带有 SeekBars、按钮等)以及我之前绘制的所有内容作为背景。当 ListView 滚动时,此背景不必滚动。如何创建和设置这样的 ListView ?
我的.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<com.project.MyView
android:id="@+id/main_view"
android:layout_width="wrap_content"
android:layout_height="fill_parent" />
</LinearLayout>
最佳答案
将您的自定义 View 作为整个屏幕的背景。您可以通过将 Root View 设为您的自定义 View 来做到这一点。然后计算对角的触摸并使您的 subview 即 ListView 可见。
关于android - 如何在 onDraw 方法中创建和显示 ListView ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10496044/