棄用 getResources().getColor(R.color.colorWhite)被棄用,相應替換的方式為: 替換 替換的getColor ContextCompat.getColor(context,顏色值);