是否可以在 Gridview 中修改字体类型、字体大小、字体颜色(Android API 级别 8 及以上)?如何?
public class MainActivity extends Activity {
GridView gridView;
static final String[] numbers = new String[] {
"P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z"};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setActivityBackgroundColor();
setContentView(R.layout.activity_main);
gridView = (GridView) findViewById(R.id.gridView1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, numbers);
gridView.setAdapter(adapter);
}
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridView1"
android:numColumns="auto_fit"
android:gravity="center"
android:columnWidth="55dp"
android:stretchMode="columnWidth"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:horizontalSpacing="10dp"
android:verticalSpacing="10dp"
>
</GridView>
提前致谢