If I were to get an art asset made intended for use as the background of an ActionBar, what size (in pixels) should I request? Everything I have found referencing the size of an ActionBar has been in dp, so I'm unsure what would be the best absolute size to go with for the actual .png file. Thanks!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.