dynamically changing text size


Last Updated:

  1. gavin

    gavin New Member This Topic's Starter

    Joined:
    May 18, 2010
    Messages:
    1
    Likes Received:
    0
    I want to allow users to choose which text size to view my app in. I have a select menu which takes the value and saves it in preferences. I am updating my TextViews in my layouts using the code below:

    Code (Text):
    1. TextView copyrightText = (TextView) findViewById(R.id.copyright);
    2. copyrightText.setTextSize(mTextSize);
    Is it possible to do the same thing for ListViews? When I uncomment the second line I get an error. I'm not sure I understand how ArrayAdapter works:

    Code (Text):
    1. TextView list_item_text = (TextView) findViewById(R.id.list_item_text);
    2.  //list_item_text.setTextSize(mTextSize);
    3.  
    4. String[] values = getResources().getStringArray(R.array.values_array);
    5. ArrayAdapter<String> mArrayAdapter = new ArrayAdapter<String>(this, R.layout.list_item, values);
    6. setListAdapter(mArrayAdapter);
    7. ListView lv = getListView();
    Thanks!
     

    Advertisement

Share This Page

Loading...