[英]Change background color of flutter app icon
I want to change background icon to #fe6017
.我想将背景图标更改为
#fe6017
。 I use flutter_launcher_icons
, set adaptive_icon_background: "#fe6017"
.我使用
flutter_launcher_icons
,设置adaptive_icon_background: "#fe6017"
。 But it doesn't work.但它不起作用。 I also try to resize image.
我也尝试调整图像大小。 But it always shrinks and put
white
color around my image.但它总是缩小并在我的图像周围放置
white
。 Thank you.谢谢你。
Open android
folder in Android Studio.在 Android Studio 中打开
android
文件夹。
Right-click the res folder and select New > Image Asset.右键单击 res 文件夹和 select New > Image Asset。
In the Icon Type field, select Launcher Icons (Adaptive & Legacy).在图标类型字段中,select 启动器图标(自适应和旧版)。
In the Foreground Layer tab, select an Asset Type, and then specify the asset in the field underneath:在前景层选项卡中,select 是资产类型,然后在下面的字段中指定资产:
Name - If you don't want to use the default name, type a new name.名称 - 如果您不想使用默认名称,请键入一个新名称。 If that resource name already exists in the project, as indicated by an error at the bottom of the wizard, it's overwritten.
如果该资源名称已存在于项目中(如向导底部的错误所示),则会被覆盖。 The name can contain lowercase characters, underscores, and digits only.
名称只能包含小写字符、下划线和数字。
Trim - To adjust the margin between the icon graphic and border in the source asset, select Yes.修剪 - 调整源资产中图标图形和边框之间的边距,select 是。 This operation removes transparent space, while preserving the aspect ratio.
此操作删除透明空间,同时保留纵横比。 To leave the source asset unchanged, select No.
要保持源资产不变,select No.
Color - To change the color for a Clip Art or Text icon, click the field.颜色 - 要更改剪贴画或文本图标的颜色,请单击该字段。 In the Select Color dialog, specify a color and then click Choose.
在 Select 颜色对话框中,指定颜色,然后单击选择。 The new value appears in the field.
新值出现在该字段中。
Resize - Use the slider to specify a scaling factor in percent to resize an Image, Clip Art, or Text icon.调整大小 - 使用 slider 指定比例因子以调整图像、剪贴画或文本图标的大小。 This control is disabled for the background layer when you specify a Color asset type.
当您指定颜色资源类型时,此控件对背景层禁用。 Click Next.
点击下一步。
You can create an image filled with color #fe6017 and use it for adaptive_icon_background as in example您可以创建一个填充有颜色#fe6017 的图像并将其用于adaptive_icon_background,如示例
flutter_icons:
android: "launcher_icon"
ios: false
image_path: "assets/icon/icon.png"
adaptive_icon_background: "assets/icon/icon-background.png"
adaptive_icon_foreground: "assets/icon/icon.png"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.