if (now.getMonth()!=date.getMonth()){
這個的邏輯是不對的,只能針對當前月份
這個的邏輯是不對的,只能針對當前月份
2017-11-23
講的很好,有兩個地方把我絆住了, View view = LayoutInflater.from(context).inflate(R.layout.calendar_layout, this, false);//插入布局
addView(view); btn1 = findViewById(R.id.calendar_btn_1);btn2 = findViewById(R.id.calendar_btn_2) gridView = findViewById(R.id.calendar_gridView); adapter前面有個 cells.clear()
addView(view); btn1 = findViewById(R.id.calendar_btn_1);btn2 = findViewById(R.id.calendar_btn_2) gridView = findViewById(R.id.calendar_gridView); adapter前面有個 cells.clear()
2017-11-21
calendar.get(Calendar.DAY_OF_WEEK)獲得是周幾,周一的話返回的是2,周日返回才是1,減一后等于0,這個時候才表示開頭沒有cell給上個月
2017-08-11