简体   繁体   English

如何在 Android Studio 中查看自定义矢量资源(由 SVG 格式添加)的预览?

[英]How to see a preview of custom vector asset (added by SVG format) in Android Studio?

I know i can use my own svg as icons by browsing them from the asset studio but it just show the name not the exact icon of the svg, i can't know just by name what that icon is look like, so can i view them while adding them to project like they are showing in below image?我知道我可以通过从资产工作室浏览它们来使用我自己的 svg 作为图标,但它只显示名称而不是 svg 的确切图标,我不能只知道那个图标的名称,所以我可以查看将它们添加到项目中,如下图所示?

I have many icon on my computer can i add them to that list, so that i can see them visually when i want to add a new vector asset.我的电脑上有很多图标,我可以将它们添加到该列表中,以便在我想添加新的矢量资产时可以直观地看到它们。 I tend to think that it can be done because then icons which android asset studio is shows must be stored in a directory from where it pulls when when i open asset stdio, if i can add my svg to that directory then android studio may may also pull them too with default clip arts and they may also show up in asset studio, does anyone know what that directory is, or any other way of doing this.我倾向于认为它可以完成,因为 android 资产工作室显示的图标必须存储在当我打开资产 stdio 时它拉出的目录中,如果我可以将我的 svg 添加到该目录,那么 ZC31B32364CE19CA58FCD150A417 工作室也可以使用默认剪贴画也将它们拉出来,它们也可能出现在资产工作室中,有没有人知道该目录是什么,或者任何其他方式。

Note android studio does not give such option via UI注意 android studio 没有通过 UI 提供这样的选项

矢量资产工作室

When you add a new vector asset (assuming you've added it in the drawable directory), it gets added in the drawable directory.当您添加一个新的矢量资源(假设您已将其添加到可绘制目录中)时,它会被添加到可绘制目录中。 It is generally saved by the name ic_thatSVGname .它通常以名称ic_thatSVGname保存。 So it gets the prefix IC.所以它得到前缀IC。 So please browse in the drawable directory and you will find your vector asset.所以请浏览drawable目录,你会找到你的矢量资产。 Then double click on it so that it opens and you can see the preview on right side of the screen.然后双击它以打开它,您可以在屏幕右侧看到预览。 It it doesn't, just click the PREVIEW button which also reside on the right side of the Android Studio.它没有,只需单击同样位于 Android Studio 右侧的 PREVIEW 按钮。 So that means just search for that in drawable directory.所以这意味着只需在可绘制目录中搜索它。 And while adding new vector assets, right click on the DRAWABLE DIRECTORY only so that it gets into that directory else it might end up outside it.在添加新的矢量资源时,仅右键单击 DRAWABLE DIRECTORY 以便它进入该目录,否则它可能最终会出现在它之外。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM