您的位置:首页 > 移动开发 > Android开发

android--如何修改progressDialog内文字字体大小

2013-12-17 09:34 721 查看
//先得到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);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息