仔細(xì)分析代碼,發(fā)現(xiàn)問題出在代碼: getWindowManager().getDefaultDisplay().getMetrics(dm) Initialize a DisplayMetrics object from this display's data. dm = getResources().getDisplayMetrics() Return the current display metrics that are in effect for this resource object. The returned object should be treated as read-only.