首页 > 其他 > 详细

根据屏幕大小设置字体

时间:2014-07-21 22:45:17      阅读:239      评论:0      收藏:0      [点我收藏+]
public static int adjustFontSize(int screenWidth, int screenHeight){
     
    if (screenWidth <= 240) {        // 240X320 屏幕
         
        return 10;
 
    }else if (screenWidth <= 320){   // 320X480 屏幕
 
        return 14;
 
    }else if (screenWidth <= 480){   // 480X800 或 480X854 屏幕
 
        return 24;
 
    }else if (screenWidth <= 540){   // 540X960 屏幕 
 
        return 26;
         
    }else if(screenWidth <= 800){    // 800X1280 屏幕 
 
        return 30;
         
    }else{                          // 大于 800X1280
 
        return 30;
         
    }
}

根据屏幕大小设置字体

原文:http://blog.csdn.net/anjon520/article/details/38024383

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!