Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Programmatically set typeface and textsize of Spinner

Programmatically set typeface and textsize of Spinner

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Programmatically set typeface and textsize of Spinner

Postby mobiforms » Mon Sep 14, 2009 9:21 pm

For other items setTypeface and setTextSize are available, but not for
Spinner. I would like to have a mechanism that dynamically changes
the Spinner without using a fixed XML definition. I am trying to re-
program the default android.R.layout.simple_spinner_item and
android.R.layout.simple_spinner_dropdown_item containers. I have
tried the following code without success. Where am I going wrong?

class ComboBox extends Spinner {
private int listid;
private ArrayList<String> alist = new ArrayList<String>();
private TextView ssi;
private CheckedTextView ssdi;

public ComboBox (Context context,int listid) {
super(context);
this.listid = listid;
ArrayAdapter<String> ladapt = new ArrayAdapter<String>(context,
android.R.layout.simple_spinner_item, alist);
ladapt.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
setAdapter(ladapt);
ssi = (TextView)findViewById
(android.R.layout.simple_spinner_item);
ssdi = (CheckedTextView)findViewById
(android.R.layout.simple_spinner_dropdown_item);
}

public int getId() {
return listid;
}

public void addItem(String txt) {
alist.add(txt);
}

public void setTypeface(Typeface tf) {
ssi.setTypeface(tf);
ssdi.setTypeface(tf);
}

public void setTextColor(int colour) {
ssi.setTextColor(colour);
ssdi.setTextColor(colour);
}

public void setTextSize(int sz) {
ssi.setTextSize(sz);
ssdi.setTextSize(sz);
}
}
mobiforms
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Sep 14, 2009 9:11 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests