![](/img/trans.png)
[英]How to update all the items in ArrayList due to shift in drag and drop of recyclerview
[英]RecyclerView shift items
您不應該關心基於星期幾的列中的位置。
一種方法是每天有一個 Date 實例。 要以上述形式顯示一年,您需要有一個 7x52 的 gridview。 gridview 中的第一個單元格將具有一年的第一天。 第二天將轉到第二個位置等。您還可以從中提取月份中的日期以產生您想要的結果。
為此,您將需要標題。 檢查這個http://blog.sqisland.com/2014/12/recyclerview-grid-with-header.html
為網格適配器創建天數的一種方法:
For every day out of the 365 {
Calendar newDay = Calendar.getInstance();
newDay.set(Year, 2016);
newDay.set(Calendar.Day_Of_Year, 0<i<365);
Arraylist adaptersData.add(newDay);
{
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.