Ben android çalışıyorum.
Yerin bir listesi var. Ben bu listeden bir yere tıkladığında bunu istiyorum. tıklandığında gibi görünüyor böylece seçilen satırın Sonra rengi kısa bir süre için BLUE değiştirilmelidir.
Bu deniyorum kodu şöyledir: -
mListView.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long duration)
{
view.setBackgroundResource(R.drawable.fsq_custom_background);
}
}
Bu fsq_custom_background.xml çekilebilir klasörde depolanır: -
<?xml version=1.0 encoding=utf-8?>
<selector xmlns:android=http://schemas.android.com/apk/res/android>
<item
android:state_pressed=true
android:state_enabled=true
android:[email protected]/the_background_color />
</selector>
bu the_background_color.xml : -
<?xml version=1.0 encoding=UTF-8?>
<shape xmlns:android=http://schemas.android.com/apk/res/android>
<solid android:color=#FF1212 />
</shape>
ama yine de seçilen satırın rengi değişmez. i yaptıklarını hata bana yardım edin. Çok teşekkür ederim.