Hey Delphi developers! If you've ever generated Android splash screen images using Delphi IDE and noticed they appear **stretched**, here's a simple way to fix that and ensure your splash image is always **centered without distortion**.
### Steps to Fix It:
) After building your project, go to the following paths where the splash screen files are generated:
if your target android system is 64bit:
<YourProjectDirectory>\Android64\Debug\<YourProjectName>\res\drawable
<YourProjectDirectory>\Android64\Debug\<YourProjectName>\res\drawable-anydpi-v21
or
<YourProjectDirectory>\Android\Debug\<YourProjectName>\res\drawable
<YourProjectDirectory>\Android\Debug\<YourProjectName>\res\drawable-anydpi-v21
Copy both files **`splash_image_def.xml | splash_image_def-v21.xml`** from this folder and paste it into a new directory in your project (e.g., **`YourProjectDirectory\res\theme`**).
2 Open both files in Delphi IDE and add the following line inside each file:
android:scaleType="centerInside"
3 Deployment:
Go to Project > Deployment in Delphi IDE.
Select all configurations for your target system.
Click on the column header "Local Name" to sort the list by name.
Scroll down, find the default splash xml files, uncheck them, and replace them with your newly edited files.
Don’t forget to set the remote path for the new files according to the unchecked ones.
That’s it! Clean&Rebuild and deploy your project, and you’ll see your splash image properly centered on all devices without any stretching!
-------------------------------------------------------------------------------------------------
I hope Embarcadero adds this by default in an upcoming version to fix the issue.
-------------------------------------------------------------------------------------------------
Hope this helps, and happy coding! If you have questions, feel free to drop them below.