根据配置,操作栏的高度可以是40,48或56 dp。 这意味着,由于Android如何通过密度来缩放内容,因此有9种不同的绝对像素高度。 当然,宽度取决于设备。
您最好的选择是使用9-patch drawables或使用形状XML创建drawable,以便它可以适应几乎无限数量的设备配置。
The action bar can be 40, 48, or 56 dp in height depending on configuration. This means that because of how Android scales things by density there are 9 different absolute pixel heights. The width varies depending on the device, of course.
Your best bet is to use 9-patch drawables or create the drawable using a shape XML so that it can adapt to the nearly infinite number of configurations of devices.
请发表评论