andriod.view.display type
时间: 2024-06-05 08:10:18 浏览: 14
Android provides a Display class in the `android.view` package that represents a display on a device. The `Display` class provides methods to get information about the display such as its size, orientation, pixel density, and refresh rate.
The `getDisplay()` method of the `WindowManager` class can be used to obtain a `Display` object that represents the default display of the device. Once you have a `Display` object, you can use its methods to get information about the display.
The `getDisplayMetrics()` method of the `Display` class returns a `DisplayMetrics` object that contains information about the display's density, width, height, and other characteristics.
The `getRotation()` method of the `Display` class returns the current rotation of the display in degrees. The rotation can be one of four possible values: `Surface.ROTATION_0`, `Surface.ROTATION_90`, `Surface.ROTATION_180`, or `Surface.ROTATION_270`.
Overall, the `Display` class provides a convenient way to obtain information about the display of an Android device and to adjust your application's behavior based on that information.
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)