問題タブ [android-recyclerview]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - ListView と同じように、CursorAdapter を recycleview に設定することはできますか?
sqliteにリンクされたカーソルを使用する必要があるため、プロジェクトでリストビューを置き換えるソリューションを今までグーグルで検索しませんでした。
次の古い方法:
listview.setAdapter(cursorAdapter)
この方法で、データベース内のデータを処理するカーソルを取得できます。
しかし、現在、recycleview.setAdapter(recycleview.adapter)
BaseAdapter を拡張するアダプターを認識しません。
誰でも私に手を差し伸べることができますか?
java - Android 5.0 - Add header/footer to a RecyclerView
I spent a moment trying to figure out a way to add a header to a RecyclerView
, unsuccessfully.
This is what I got so far:
The LayoutManager
seems to be the object handling the disposition of the RecyclerView
items. As I couldn't find any addHeaderView(View view)
method, I decided to go with the LayoutManager
's addView(View view, int position)
method and to add my header view in the first position to act as a header.
Aaand this is where things get uglier:
After getting several NullPointerExceptions
trying to call the addView(View view)
at different moments of the Activity creation (also tried adding the view once everything is set up, even the Adapter's data), I realized I have no idea if this is the right way to do it (and it doesn't look to be).
PS: Also, a solution that could handle the GridLayoutManager
in addition to the LinearLayoutManager
would be really appreciated!
android - Android L: RecyclerView の高速スクロール
私はRecyclerView
自分のアプリケーションで大量のデータを使用しようとしていListView
ます.. この回答からのアプローチは、 では機能しましたがListView
、 では機能しませんRecyclerView
。true
レイアウトで高速スクロールを設定しRecyclerView
ても、まだ機能しません。
はRecyclerView
Android L の高速スクロールをサポートしていますか? ドキュメントでこれについて何も見つけることができません。