7
res/values/colors.xml
dosyamda oluşturulan renkleri kullanmaya çalışıyorum. Dinamik Program derleme değil arama yapmak ve ne zaman Ama bunun yerine tavsiye eder: Should pass resolved color instead of a resource id.
Android'de dinamik olarak kaynaklarda renkler nasıl çağrılır?
Renk Kodu:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="gold">#857500</color>
<color name="green">#0B3B0B</color>
</resources>
Etkinlik Kodu:
title.setTextColor(R.color.green);
help.setTextColor(R.color.gold);
settings.setTextColor(R.color.gold);
logout.setTextColor(R.color.gold);
profile.setTextColor(R.color.green);
yukarıdaki kod onaylanmamıştır Bu ContextCompat.getColor (CalenderDetailActivity.this, R.color.green) –