Tejaswini
Tejaswini

Reputation: 357

android listview fonts change dynamically

I am creating application where in i have used preferences for changing font settings. I want to change the list view 's text through those preference values. Have used check box preference for bold and italic. and list preference for font size How can i do this? Please guide me.

Upvotes: 0

Views: 523

Answers (1)

Dmitry Zaytsev
Dmitry Zaytsev

Reputation: 23972

In your ListView's adapter:

public View getView(int position, View convertView, ViewGroup parent) {
    TextView tv;
    if(convertView==null){
        tv=new TextView(...); //create new TextView
    }else tv=(TextView) convertView;

    //now here set your tv text, font etc.

    return v;
}

Upvotes: 1

Related Questions