Jump to content
bravesofts

🔥 Delphi Android Tip: Fix Stretched Splash Images in Your Delphi Apps! 🚀

Recommended Posts

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:

  1. )  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`**).

  1. 2  Open both files in Delphi IDE and add the following line inside each file:
android:scaleType="centerInside"
  1. 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. 

 

 

1.png

2.png

Edited by bravesofts
add snapshots

Share this post


Link to post
30 minutes ago, Remy Lebeau said:

Did you file a report to request it?

Not yet... I wish someone could do it for me. I do have an account there, but the website’s interface is far from user-friendly.!!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×