尺寸级Android上的Java

尺寸级Android上的Java

问题描述:

什么是类的等价形式 java.awt.Dimension中的为Android?

What is the equivalent form of class java.awt.Dimension for android?

您可以使用的 对<整数,整数GT; 这是Android通用的元组类。 (您将需要更换的getWidth()的getHeight()第一第二,虽然。)在Android API的Andr​​oid团队似乎使用即席类用于此目的,例如的 Camera.Size

You could use Pair<Integer, Integer> which is Android's generic tuple class. (You would need to replace getWidth() and getHeight() with first and second, though.) In other places of the Android API the Android team seems to use ad-hoc classes for this purpose, for instance Camera.Size.