Android layer-list spritesheet -


i have created sprite sheet (single image contains multiple images) 4 different icons. create layer-list uses different parts of images make single image, example:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >     <item android:drawable="@drawable/spritesheet"/>     <item android:drawable="@drawable/spritesheet"/>     <item android:drawable="@drawable/spritesheet"/>     <item android:drawable="@drawable/spritesheet"/> </layer-list> 

for example sprite sheet this:

sprite sheet

and final result this:

enter image description here

i have tried different options available here can't find solution.

why don't use parts of picture?

@drawable/layers.xml, example:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >    <item android:drawable="@drawable/part1"/>    <item android:drawable="@drawable/part2"/>    <item android:drawable="@drawable/part3"/>    <item android:drawable="@drawable/part4"/> </layer-list> 

and if full picture needed, can use fifth (the full) picture, or create parts in relativelayout remains app light-weight.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c++ - Using OpenSSL in a multi-threaded application -

All overlapping substrings matching a java regex -