Ate you need to change the font size programmatically, you need to use your 
own simplecursoradapter.


scAdapter = new simplecursoradapter_textsize(this,
> com.dim.list_orders.R.layout.row_list, cursor, new String[] {
> "name", "count(*)" }, new int[] { R.id.text1,
> R.id.text2 }, 1);
> public class simplecursoradapter_textsize extends SimpleCursorAdapter {
> private int layout;
> private String[] from;
> private int[] to;
> private String size_text;
> public simplecursoradapter_textsize(Context context, int layout,
> Cursor c, String[] from, int[] to, String size_text) {
> super(context, layout, c, from, to);
> this.layout = layout;
> this.from = from;
> this.to = to;
> this.size_text = size_text;
> }
> @Override
> public void bindView(View v, Context context, Cursor c) {
> for (int i = 0; i < from.length; i++) {
> TextView t = (TextView) v.findViewById(to[i]);
> t.setText(c.getString(c.getColumnIndex(from[i])));
> if (size_text.equals("1")) {
> t.setTextSize(getResources().getDimension(
> com.dim.list_orders.R.dimen.text_small));
> } else if (size_text.equals("3")) {
> t.setTextSize(getResources().getDimension(
> com.dim.list_orders.R.dimen.text_large));
> } else {
> t.setTextSize(getResources().getDimension(
> com.dim.list_orders.R.dimen.text_medium));
> }
> }
> }
> @Override
> public View newView(Context context, Cursor cursor, ViewGroup parent) {
> final LayoutInflater inflater = LayoutInflater.from(context);
> return inflater.inflate(layout, parent, false);
> }
> }


вторник, 28 августа 2012 г., 6:39:37 UTC+3 пользователь RAM написал:
>
> how to resize the font size of a listview/gridview text
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to