开发者

Avoiding duplicate resources in android project

I have some images in my drawable folder and they have landscape versions in drawable-land. However I want some of the landscape images to be shared, as it seems a waste to duplicate the file with a different name. Is it possible to make a sym link (shortcut) or something for one of the duplicated files to prevent wasting space

Folder explanation below as I'm not great at explaining myself:

/drawable 
> image1.png
>开发者_开发知识库 image2.png 
/drawable-land
>image1.png  <-- This image
>image2.png  <-- is identical to this file


Insead of image2.png you can definde image2.xml with following contents (obviously, place it at landscape folder):

<bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/image1" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜