Givemepass's Android 惡補筆記

如何取得螢幕解析度

| Comments

因為太常用了, 所以筆記一下

    DisplayMetrics metrics = mContext.getResources().getDisplayMetrics();
    int height = metrics.heightPixels;
    int width = metrics.widthPixels;

更精確地可以參考這個
ScreenInfo

Comments

comments powered by Disqus