我想用以下代码更改gridview的字体:
GridView gv = (GridView) findViewById(R.id.gridView1);
String[] numbers = new String[] {
"1" , "2" ,"3","4","5","6","7","8","9","10"
};
ArrayAdapter adapter = new ArrayAdapter(this,
android.R.layout.simple_list_item_1,
numbers);
gv.setAdapter(adapter);
答案 0 :(得分:0)
我认为这就是你所需要的:
“您必须更改gridview的baseadapter类中的字体大小。
像这样:
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv;
if (convertView == null) {
tv = new TextView(context);
tv.setLayoutParams(new GridView.LayoutParams(100, 80));
tv.setTextSize(20); //text size in gridview
}
gridview只显示
gridview.setAdapter(new MyAdapter (thi)); //MyAdapter class is where the getView method run sets the setAdapter to contain."