android--如何修改progressDialog內文字字體大小

//先得到Dialog的整個view

View v=dialog.getWindow().getDecorView();

//調用私有方法

setDialogText(v);


//遍歷整個View中的textview,然後設置其字體大小

private void setDialogText(View v){
if(v instanceof ViewGroup){
ViewGroup parent=(ViewGroup)v;
int count=parent.getChildCount();
for(int i=0;i<count;i++){
View child=parent.getChildAt(i);
setDialogText(child);
}
}else if(v instanceof TextView){
((TextView)v).setTextSize(40);
}
}


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章