last day (16 days later) » 

10:40 AM
0
A: Confusion in 9 patch image

IntelliJ Amiya At first check your 9 Patch Images . Make sure its properly patched or not . Error:Execution failed for task ':app:mergeDebugResources'. Some file crunching failed, see logs for details You can add this in your build.gradle section android { aaptOptions { cruncherEnabled = f...

 
i did it all once again . and it does not show any error but when i give width and height to match parent . image is streched fully . Whats wrong there
 
@FaisalAhmed Okay . That is another case . You can share your xml
 
Look i have edited my Question with xml
 
add android:gravity="center" android:scaleType="centerInside"
Your parent is match_parent thats why . Let me inform its working or not
 
Its works fine now. But even image which is not 9 patch is also working in the same way . Then whats difference in them they both are working in same way . And what android:scaleType="centerInside" does
 
10:40 AM
@FaisalAhmed Happy to hear thats works
 
What i want is when i use image as background image logo should not be streched .However it should occupy whole screen . for example my logo background colour is green .Then green colour should occupy whole screen
 
 
2 hours later…
12:40 PM
why i can not set image with and height for example match parent and logo should not be streched however other part in image should be streched
I just done some testing
and it works well with android:background="@drawable" instead of android:src="@drawable"
why so ?
and thanks alot for helping me out
 

  last day (16 days later) »