Autore Topic: Cambiare Font ListView  (Letto 406 volte)

Offline nunzio giulio

  • Nuovo arrivato
  • *
  • Post: 2
  • Respect: 0
    • Mostra profilo
Cambiare Font ListView
« il: 26 Maggio 2014, 12:12:42 CEST »
0
ciao ragazzi, ho un codice con una listview popolata con SimpleAdapter. mi aiutate a cambiare il font delle textview della lista? non riesco proprio. ecco il codice:

Codice (Java): [Seleziona]
ArrayList<Song> songList=new ArrayList<Song>();
       
       
        Song [] song={
                        new Song("I saw her standing there","Lennon/McCartney",R.drawable.a1),
                        new Song("Misery", "Lennon/McCartney", R.drawable.a1),
                        new Song("Anna(Go to him)","Alexander",R.drawable.a1),
                        new Song("Chains","Goffin/King",R.drawable.a1),
                        new Song("Boys","Dixon/Farrel",R.drawable.a1),
                        new Song("Ask me why", "Lennon/McCartney", R.drawable.a1),
                        new Song("Please Please Me", "Lennon/McCartney", R.drawable.a1),
                        new Song("Love me do", "Lennon/McCartney", R.drawable.a1),
                        new Song("P.S. I love you", "Lennon/McCartney", R.drawable.a1),
                        new Song("Baby it's you", "David/Williams/Bacharach", R.drawable.a1),
                        new Song("Do you want to know a secret", "Lennon/McCartney", R.drawable.a1),
                        new Song("A taste of honey", "Scott/Marlow", R.drawable.a1),
                        new Song("There's a place", "Lennon/McCartney", R.drawable.a1),
                        new Song("Twist and Shout", "Medley/Russel", R.drawable.a1),
        };
       
        for(int i=0;i<14;i++){
                songList.add(song[i]);
        }
       
       
       
       
        ArrayList<HashMap<String, Object>> data=new ArrayList<HashMap<String,Object>>();
       
       
        for(int i=0;i<songList.size();i++){
                Song p=songList.get(i);
               
                HashMap<String,Object> SongMap=new HashMap<String, Object>();
               
                SongMap.put("img", p.getImg());
                SongMap.put("title", p.getTitle());
                SongMap.put("subtitle", p.getSubtitle());
                data.add(SongMap);  
        }
       
       
        String[] from={"img","title","subtitle"};
        int[] to={R.id.imageAlb,R.id.titleSong,R.id.subtitleSong};
       

        SimpleAdapter adapter=new SimpleAdapter(getApplicationContext(),data,R.layout.song_item, from,to);
       
        ((ListView)findViewById(R.id.songListView)).setAdapter(adapter);