When I go to import a vector image using Android Vector Asset Studio, it becomes distorted, even in the preview. One of the vectors I was attempting to use was the photo outline straight from the Material site.
Here is what it is supposed to look like:
This is what it looks like in Android:
Here is one other example with what it's supposed to look like and then how it looks in Android:
If you want any other info let me know. Any help would be greatly appreciated.
Android Studio includes a tool called Vector Asset Studio that helps you add material icons and import Scalable Vector Graphic (SVG) and Adobe Photoshop Document (PSD) files into your project as vector drawable resources.
A VectorDrawable is a vector graphic defined in an XML file as a set of points, lines, and curves along with its associated color information. The major advantage of using a vector drawable is image scalability.
You can import an SVG file as a VectorDrawable in Android Studio, follow these steps : "Right-click" on the res folder and select new > Vector Asset. Select the Local File option and browse to your . svg file.
use <androidx.appcompat.widget.AppCompatImageView
instead of ImageView
and also use app:srcCompat
insted of android:src=
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With