带有简单光标适配器项目的列表视图已选中,但在滚动期间未选中

2024-04-25

我有一个问题,我无法在 SO 上找到答案 - 所有问题都在 SO 上解决,其中有太多不同的问题并且不起作用。 问题是——
1. ListView中被点击的行(点击后标记为蓝色背景和复选框)在滚动后失去了被点击的标记(选中的复选框和颜色)。
2. 甚至更多 - 在滚动期间标记其他行,即使没有单击。
ListView 绑定到我的自定义简单游标适配器,它从 SQLite 数据库获取数据。 列表视图的每一行都有许多带有文本框和一个复选框的列 - 因此 ListView 中的默认多项选择模式选择在我的情况下不起作用 - 我使用 onItemClick 来获取所选项目。在 ListView Activity 中,我自己处理列表中选中的项目。 ListView 也在 Horizo​​ntalScrollView 中。

这些是我的类和布局:

我的活动列表

public class MyListActivity extends ListActivity
    { .....
    public void initComponents()
    {
        baza = dbMan.openDB(true);
        cursorListaFaktur = wyswietlWszystkieTowary();
        startManagingCursor(cursorListaFaktur);
                fakturyLista = this.getListView();
        fakturyLista.setScrollContainer(true);
        fakturyLista.setScrollingCacheEnabled(true);

        fakturyLista.setItemsCanFocus(false);
        fakturyLista.setTextFilterEnabled(true);
        fakturyLista.setItemChecked(0, true);


        String[] columns = new String[] { "NRDOK", "NAZWADOK", "ANULOWANY",
                "NAZWASKR", "DATA", "SUMA", "MIEJSCOWOSC", "TERMIN",
                "WYEKSPORTOWANY", "MSPRZ_DOKUMENT.UWAGI" };

        int[] kontrolki = new int[] { R.id.ID_FakturyRow_NrFakt,
                R.id.ID_FakturyRow_Typ, R.id.ID_FakturyRow_Anulowany,
                R.id.ID_FakturyRow_DataSprzed,  
                                R.id.ID_FakturyRow_Kontrahent,
                R.id.ID_FakturyRow_Suma, R.id.ID_FakturyRow_Miejscowosc,
                R.id.ID_FakturyRow_Termin, R.id.ID_FakturyRow_Wyeksp,
                R.id.ID_FakturyRow_Uwagi };

        String[] columnsRaportKasowy = new String[] { "NRDOK", "NAZWADOK",
                "GOTOWKA", "GOTOWKA", "NAZWASKR", "DATA", "UWAGI" };

        int[] kontrolkiRaportKasowy = new int[] {
                R.id.ID_RaportKasowyRow_NrFakt,
                                R.id.ID_RaportKasowyRow_Typ,
                R.id.ID_RaportKasowyRow_Wplata,
                R.id.ID_RaportKasowyRow_Wyplata,
                R.id.ID_RaportKasowyRow_Kontrahent,
                R.id.ID_RaportKasowyRow_DataSprzed,
                R.id.ID_RaportKasowyRow_Uwagi };

        if (raportKasowy)
        {
            adapterFaktury = new MSprzedazRaportKasowyAdapter(this,
                  R.layout.raportkasowy_row, cursorListaFaktur,  
                  columnsRaportKasowy,   kontrolkiRaportKasowy);
        }
        else
        {
            adapterFaktury = new 
                        MSprzedazListViewAdapter(this,R.layout.faktury_row,
                         cursorListaFaktur, columns, kontrolki);
        }
            fakturyLista.setOnItemClickListener(new OnItemClickListener() {

                public void onItemClick(AdapterView<?> arg0, View arg1,
                        int arg2, long arg3)
                {
                    LinearLayout linLay = (LinearLayout) arg1;
                    ArrayList<View> kontrolki = arg1.getTouchables();
                    CheckBox chBox = (CheckBox) kontrolki.get(0);
                    chBox.setChecked(!chBox.isChecked());
                    Cursor cursor = adapterFaktury.getCursor();
                    cursor.moveToPosition(arg2);
                    String tekstKom = "";
                              if(MSprzedazUtils.znajdzIdWliscieZazn(
                              cursor.getInt(cursor.getColumnIndex("_id"))
                              , listaZaznaczonych) == null)
                    {

            listaZaznaczonych.add(cursor.getInt(cursor.getColumnIndex("_id")));

            linLay.setBackgroundColor(Color.rgb(110, 151, 186));

                        MSprzedazUtils.wpisDoLoga(tekstKom);

                    }
                    else
                    {
                        try
                        {
                        listaZaznaczonych.remove((int)  
                                            MSprzedazUtils.znajdzIdWliscieZazn(
                                          cursor.getInt(cursor.getColumnIndex("_id")),
                                           listaZaznaczonych));
                        MSprzedazUtils.wpisDoLoga(tekstKom);
                        }
                        catch(IndexOutOfBoundsException ex)
                        {


                        MSprzedazUtils.wpisDoLoga("Błąd"+tekstKom);
                        }
                    }
                }
            });

简单光标适配器

public class MySimpleCursorAdapter extends SimpleCursorAdapter
        {
            class ViewHolder
        {
            CheckBox chckBoxZazn;
            LinearLayout linLay;
            TextView nrDok;
            TextView typDok;
            boolean isSelected;
            TextView txtData;
            TextView txtKontrahent;
            TextView txtSuma;
            TextView txtAnulowany;
            TextView txtMiejscowosc;
            TextView txtTermin;
            TextView txtWyeksp;
            TextView txtUwagi;
        }

        @Override
        public void bindView(View convertView, Context context, Cursor cursor)
        {
            if (convertView.getTag() != null)
                holder = (ViewHolder) convertView.getTag();
            {
                // holder.linLay = (LinearLayout)convertView;
                holder.chckBoxZazn = (CheckBox) convertView.findViewById(R.id.ID_FakturyRow_ChckBoxFakturyWybor);
                holder.nrDok = (TextView) convertView.findViewById(R.id.ID_FakturyRow_NrFakt);
                holder.typDok = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Typ);
                holder.txtAnulowany = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Anulowany);
                holder.txtData = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Kontrahent);
                holder.txtKontrahent = (TextView) convertView.findViewById(R.id.ID_FakturyRow_DataSprzed);
                holder.txtMiejscowosc = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Miejscowosc);
                holder.txtSuma = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Suma);
                holder.txtTermin = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Termin);
                holder.txtWyeksp = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Wyeksp);
                holder.txtUwagi = (TextView) convertView.findViewById(R.id.ID_FakturyRow_Uwagi);

            }

            holder.chckBoxZazn.setTag(cursor.getPosition());


            holder.nrDok.setText(cursor.getString(cursor.getColumnIndex("NRDOK")));
            holder.typDok.setText(cursor.getString(cursor.getColumnIndex("NAZWADOK")));
            if (cursor.getString(cursor.getColumnIndex("DATA")) != null)
                holder.txtData.setText(cursor.getString(cursor.getColumnIndex("DATA")).substring(0, 10));
            else
                holder.txtData.setText("-");
            if (cursor.getInt(cursor.getColumnIndex("ANULOWANY")) == 0)
                holder.txtAnulowany.setText("NIE");
            else
                holder.txtAnulowany.setText("TAK");

            if (cursor.getString(cursor.getColumnIndex("NAZWASKR")) != null)
                holder.txtKontrahent.setText(cursor.getString(cursor.getColumnIndex("NAZWASKR")));
            else
                holder.txtKontrahent.setText("-");
            if (cursor.getString(cursor.getColumnIndex("MIEJSCOWOSC")) != null)
                holder.txtMiejscowosc.setText(cursor.getString(cursor.getColumnIndex("MIEJSCOWOSC")));
            else
                holder.txtMiejscowosc.setText("-");
            holder.txtSuma.setText(cursor.getString(cursor.getColumnIndex("SUMA")));
            if (cursor.getInt(cursor.getColumnIndex("WYEKSPORTOWANY")) == 0)
            {
                holder.txtWyeksp.setText("NIE");
                holder.txtWyeksp.setBackgroundColor(Color.BLACK);
            }
            else
            {
                holder.txtWyeksp.setText("TAK");
                convertView.setBackgroundColor(Color.DKGRAY);
            }
            if (cursor.getString(cursor.getColumnIndex("TERMIN")) != null)
                holder.txtTermin.setText(cursor.getString(cursor.getColumnIndex("TERMIN")).substring(0, 10));
            else
                holder.txtTermin.setText("-");
            holder.txtUwagi.setText(cursor.getString(cursor.getColumnIndex("UWAGI")));

            if (cursor.getCount() > 0 && cursor.getPosition() < cursor.getColumnCount())
                holder.chckBoxZazn.setChecked(jestZaznaczony[cursor.getPosition()]);

        }

        @Override
        public void onClick(View v)
        {
            if (v.isFocusable())
            {
                jestZaznaczony[cursor.getPosition()] = !jestZaznaczony[cursor.getPosition()];
                holder.chckBoxZazn.setChecked(jestZaznaczony[cursor.getPosition()]);

            }
    }

}   

listview_row.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ID_FakturyRow_KontrRow"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>

<CheckBox
    android:id="@+id/ID_FakturyRow_ChckBoxFakturyWybor"
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:focusable="false"
    android:focusableInTouchMode="false"
    android:text=""
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:textSize="10dp"
    true="" />

<TextView
    android:id="@+id/ID_FakturyRow_NrFakt"
    android:layout_width="120dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="0dp"
    android:layout_marginRight="5dp"
    android:focusable="false"
    android:maxLength="10"
    android:maxLines="1"
    android:text="NrFakt"
    android:textAppearance="?android:attr/textAppearanceSmall"
    true="" />

<TextView
    android:id="@+id/ID_FakturyRow_Typ"
    android:layout_width="40dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="0dp"
    android:layout_marginRight="5dp"
    android:focusable="false"
    android:maxLength="4"
    android:maxLines="1"
    android:text="Typ"
    android:textAppearance="?android:attr/textAppearanceSmall"
    true="" />

<TextView
    android:id="@+id/ID_FakturyRow_Anulowany"
    android:layout_width="46dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="20dp"
    android:maxLength="8"
    android:maxLines="1"
    android:text="Anulowany"
    android:textAppearance="?android:attr/textAppearanceSmall"
    android:focusable="false" />

<TextView
    android:id="@+id/ID_FakturyRow_Kontrahent"
    android:layout_width="80dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="0dp"
    android:layout_marginRight="10dp"
    android:maxLength="14"
    android:maxLines="1"
    android:text="Kontrahent"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_DataSprzed"
    android:layout_width="120dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="0dp"
    android:layout_marginRight="10dp"
    android:text="Data"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_Suma"
    android:layout_width="65dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="0dp"
    android:maxLines="1"
    android:text="Suma"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_Miejscowosc"
    android:layout_width="80dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="0dp"
    android:text="Miejscowosc"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_Termin"
    android:layout_width="75dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="35dp"
    android:layout_marginRight="25dp"
    android:maxLength="18"
    android:maxLines="1"
    android:text="Termin"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_Wyeksp"
    android:layout_width="70dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="35dp"
    android:layout_marginRight="0dp"
    android:maxLength="16"
    android:maxLines="1"
    android:text="Wyeksp"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView
    android:id="@+id/ID_FakturyRow_Uwagi"
    android:layout_width="40dp"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="0dp"
    android:text="Termin"
    android:focusable="false"
    android:textAppearance="?android:attr/textAppearanceSmall" />

列表视图布局.xml

<HorizontalScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/scroller"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginBottom="10dp"
        android:fillViewport="true" >

        <LinearLayout
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/ID_FakturyListaButtons_HeaderLayoutWrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="25dp" 
            android:orientation="vertical" >

            ....... // Text Views as Listview header
         </LinearLayout>
         <RelativeLayout
                android:id="@+id/ID_FakturyListaButtons_TabListaLayout"
                android:layout_width="fill_parent"
                android:layout_height="match_parent"
                android:orientation="vertical" 

                >

                <ListView
                    xmlns:android="http://schemas.android.com/apk/res/android"
                    android:id="@android:id/android:list"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"


                   >
                </ListView>
            </RelativeLayout>
        </LinearLayout>
 </HorizontalScrollView> 

我怎样才能使 ListView 具有许多列来显示我单击的所有且仅项目?


这是因为 Android 会回收 listView 中的行。为了克服这个问题,您需要将行状态(选中或未选中)保存在某个列表或其他内容中,并使用它来设置行选中或未选中。 在 getView() 函数中,您可以执行以下检查。这里的enabledItems是一个列表

if (enabledItems.contains(eventTime)) {
viewHolder.getCheckBox().setChecked(true);
} else {
viewHolder.getCheckBox().setChecked(false);
}

另外,请查看以下有关回收的文章。http://mobile.cs.fsu.edu/the-nuance-of-android-listview-recycling-for-n00bs/ http://mobile.cs.fsu.edu/the-nuance-of-android-listview-recycling-for-n00bs/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

带有简单光标适配器项目的列表视图已选中,但在滚动期间未选中 的相关文章

  • 为 customere xml 按钮着色时遇到问题

    我在为自定义按钮着色时遇到问题 由于某种原因 似乎无论我想应用什么颜色更改 文本或背景 按钮都保持不变 我注意到button xml具有所需的颜色和正确的形状 尽管没有出现按钮background color活动的财产 活动中的按钮
  • CursorAdapter 破坏了 CHOICE_MODE_MULTIPLE 选项

    我有一个ListFragment 我在其中添加一个CursorAdapter to my ListView 并且我希望能够单击几行以使用上下文操作栏 我使用 SherlockActionbar 当我使用一个简单的ArrayAdapter 但
  • “android.enableUnitTestBinaryResources”已弃用[重复]

    这个问题在这里已经有答案了 我刚刚更新了我的 Android Studio 现在当我构建我的项目时 我收到此错误 选项 android enableUnitTestBinaryResources 已弃用 这 当前默认值为 假 已从当前版本中
  • 如何在 Android Studio 中使用 git 分支

    我是 git 新手 我有一个非常简单的使用 git 的场景 我的第一个版本是用 Android Studio 编写的 现在我想使用一些新功能 到目前为止我做了什么 在我的 Android Studio 中启用 VCS 从 Android S
  • Android 在连接 Socket 时出现错误

    在阅读了一些express io文档并成功连接到之后 我尝试使用nodejs和express io编写简单的应用程序http chat socket io在命令行中运行下面的代码并打开后 我找到了使用 nodejs 和express io
  • 空指针异常 - findViewById()

    谁能帮我找出这个程序可能存在的问题 在里面onCreate 方法findViewById 为所有 id 返回 null 这会导致稍后出现空指针异常 我不明白为什么findViewById 找不到视图 有什么建议么 这是主要代码 public
  • 何时使用支持库

    我对 Android 支持库的用途和何时需要它感到困惑 据我了解 使用支持库的主要优点是 Android 可以在旧版本中自行实现主题和 UI 功能 而无需开发人员显式定义它们 这些关键的 UI 功能之一是操作栏 它是为 Honeycomb
  • android 表格内的可聚焦行

    我在 xml 中有一个 ScrollView 其中包括一个 TableLayout 我的问题是 每次我单击它时是否可以有一个可聚焦的行 这是我的 xml 代码
  • Glide:如何使用 Glide v4 调整 gif 大小并将其另存为文件?

    我想调整 gif 文件的大小并保存它 我尝试使用一些建议的方法 但这些方法给出了错误 后来我知道有些方法在 Glide 中已被弃用v4 byte bytes Glide with context asGif load url toBytes
  • 如何转到材料日历视图中选定的日期?

    我在用着材料日历视图 https github com prolificinteractive material calendarview在我的项目中 我可以使用 setSelectedDate 方法更改日期的选择 我有一个 今天选择 按钮
  • 如何判断一个app是原生的还是html5的? [关闭]

    Closed 这个问题是无关 help closed questions 目前不接受答案 我想知道移动应用程序是如何原生或 html5 的 有没有什么软件或者网站可以说明这一点 如何检测应用程序是本机应用程序还是 html5 您可以使用 w
  • 动态元素 ID 到 setId(int) - Android

    我看到了语法定义setId int and findViewByID int 但我们如何使用findViewById R id row1 我尝试使用这个 Object1 setId Integer parseInt repeat 它没有显示
  • 如何允许另一个应用程序访问我的应用程序的数据目录?

    假设我有一个名为 A 的应用程序 其数据目录为 com example test 现在我想制作另一个名为 B 的应用程序来修改 com example test 中的某些内容 当然我知道两者必须共享相同的签名 但我还需要什么 基本上我正在尝
  • 最大化列表视图中的可见行

    这是我的列表中项目的代码 假设我正在夸大这个TextView进入ListView
  • SignalR 与 android(Java) 有问题

    我想在 android 应用程序和 net core 服务器项目之间进行实时通信 我在 stackoverflow 中尝试了一个问题 我跟着这个one https stackoverflow com questions 32573823 h
  • 如何检查Android应用程序是否第一次打开

    我想在用户第一次打开应用程序时有一个弹出窗口 如何查看 获取应用程序被打开的次数 请帮忙 多谢 当您的应用程序启动时 在onCreate 方法 您可以检查 SharedPreference 是否存在 如果没有 则这是该应用程序第一次启动 然
  • android应用程序在模拟器上运行但在手机上运行

    我有我开发的这个应用程序 它在模拟器上运行得很好 没有任何错误 但当我尝试在手机上运行相同的代码进行测试时 应用程序崩溃并提示 filenotfoundexception 它说文件 res drawable divider horizo n
  • android:如何显示TableLayout的边框

    我如何突出显示表格布局的边框 在使用以形状为背景的圆形 shape xml 时 必须有某种方法可以为您的表格布局提供边框 圆形 xml
  • 在 Android 中的计时器内运行异步任务

    我正在开发一个基本的聊天类型应用程序 目前我正在运行代码 如下所示 class GetMsgs extends AsyncTask
  • Pinterest 喜欢自定义 GridView

    我是 Android 新手 我正在寻找网格视图的逻辑 例如为 iPhone 构建的 pinterest homescreen 应用程序 一个大号 图像来自服务器 我需要以以下形式显示并具有分页效果 即在滚动上加载图像 如果可以的话请回复 我

随机推荐

  • 指定共享对象(共享库)的名称

    Go 编译器为共享对象生成的名称是错误的 例子 go install buildmode shared linkshared github com apache thrift lib go thrift code google com p
  • Windows 安装程序和安装应用程序合并到一个文件中?

    我使用 Visual Studio 在 C 中编写了一个应用程序 我创建了一个项目设置文件 该文件在我的调试中为我创建了文件 Windows Installer 和安装应用程序都是必需的 但我想将它们合并为一个 就像当您下载应用程序时 安装
  • java中删除文件中的一行

    好的 所以我尝试使用 java lang String 从文本文件中删除行 目前我这样做的方式是跟踪行号并输入索引 索引是我要删除的行 因此 每次读取新的数据行时 我都会增加行数 现在 当我达到相同索引的行数时 我不会将数据写入临时文件 现
  • asp.net mvc相当于rails回调before_save

    您好 我正在寻找一个 ASP NET MVC 回调 以便在保存模型之前获取详细数据 Rails 中有 before save Thanks 如果您正在使用实体框架 您的标签表明 那么这个 StackOverflow 帖子 https sta
  • Async CTP 可以与可移植库一起使用吗

    我想看看异步 CTP 是否带有可移植类库 不可以 异步 CTP 对于桌面 电话 Silverlight 4 和 Silverlight 5 有不同的 dll 希望在不久的将来 所有这些平台都将原生支持任务 和异步 然后可移植类库将能够使用异
  • 依赖注入和项目参考[重复]

    这个问题在这里已经有答案了 我正在尝试了解 DI 以便更好地了解 IoC 以及其他好处 在 DI 之前 我有一个项目 其中包含一个 UI 项目 MVC 一个 BusinessLogic 项目和一个 DataAccess 项目 我还有一个 S
  • 当 Django 在 postgresql 中使用可序列化事务隔离级别时,哪些具体异常代表序列化失败?

    有时 对于 Django 中的数据库操作 需要使用比默认 已提交读 更高的隔离级别 文档警告 https docs djangoproject com en 1 11 ref databases isolation level that 在
  • StringBuilder 在 C# 中的性能?

    我有一个StringBuilder对象 我在其中添加一些字符串 如下所示 我想知道哪种方法更好 第一个是 StringBuilder sb new StringBuilder sb Append Hello How are you 第二个是
  • 使用 XSLT 转换 XML 并保留 Unicode 字符

    我的 XSLT 转换已经成功了几个月 直到我遇到带有 Unicode 字符 很可能是表情符号 的 XML 文件 我需要保留 Unicode 但 XSLT 正在将其转换为 HTML 实体 我认为将编码设置为 UTF 8 可以解决我的问题 但我
  • 为什么 copyTo(... PASTE_VALUES) 在宏中间不起作用?

    我长期使用的电子表格技术之一是就地复制 粘贴特殊值 C PSV 使用公式生成我感兴趣的值后 I C PSV 然后可以删除源数据 所以我写了一个使用这种技术的宏 但单元格最终是空的 但如果我将宏分成两个 在 C PSV 之前结束第一个宏 那么
  • 不同种类的ReaderT?

    冒着成为一个XY问题 https en wikipedia org wiki XY problem 是否有可能有一个ReaderT与不同的环境 我正在尝试类似 type AppM perms ReaderT perms IO 但是编译器抱怨
  • 如何以动态方式创建 Spring Bean。使用 Quartz SchedulerFactoryBean

    我有一个QuartzJobConfig我注册的班级Spring Quartz Beans 我按照指示SchedulerFactoryBean JobDetailFactoryBean and CronTriggerFactoryBean 我
  • 绘制动画

    我正在创建一个简单的应用程序 当用户按下按钮时 屏幕上将绘制一系列线条 并且用户将能够实时看到这些线条 几乎像动画一样 我的代码看起来像这样 已简化 UIGraphicsBeginImageContext CGSizeMake 300 30
  • 如何在Java中对多通道声音输入进行采样

    我意识到这可能是相对小众的 但这也许就是为什么无论如何都要问这个问题 我正在寻找一个硬件多输入录音控制台 例如 Alesis IO 26 来接收 Adat 光管 8 通道输入来进行信号处理 由于我还没有获得该设备 并且需要弄清楚这是否可行
  • ListView 与 getView() 由于不断的 GC 而变得缓慢?

    我的应用程序中有一个 ListView 并且我已经重写了 getView 方法 因此我可以根据行的文本更改行的 ImageView src 问题是 我注意到 ListView 滚动滞后 当我检查 DDMS 时 似乎每次滚动 ListView
  • 如何编辑 Chrome MediaRecorder 捕获的 .webm Blob

    在 Chrome 中 我在用着媒体记录器 https developer mozilla org en US docs Web API MediaStream Recording API and canvas captureStream h
  • 使用 insertUI 闪亮创建时,dragUI 不可拖动

    我用insertUI 函数来创建新的dragUI 动态地 不幸的是 新创建的dragUI行为不符合预期 我无法将它们拖动为dragUI是从创建的ui初始函数 library shiny library shinyDND ui lt flui
  • 在新窗口中打开谷歌地图。

    我创建了一个 Google Map API 我想在新选项卡 窗口 中打开它 我可以知道我的代码有什么问题吗 我可以打开新选项卡 但无法显示 Google 地图 下面是我的代码 谢谢 function newWindow var myLatl
  • 你的项目路径包含非ASCII字符android studio

    我正在安装android studio 但是当程序启动时出现这个问题 错误 1 0 您的项目路径包含非 ASCII 字符 这 很可能会导致 Windows 上的构建失败 请移动您的 项目到不同的目录 看http b android com
  • 带有简单光标适配器项目的列表视图已选中,但在滚动期间未选中

    我有一个问题 我无法在 SO 上找到答案 所有问题都在 SO 上解决 其中有太多不同的问题并且不起作用 问题是 1 ListView中被点击的行 点击后标记为蓝色背景和复选框 在滚动后失去了被点击的标记 选中的复选框和颜色 2 甚至更多 在