我有一个扩展浮动操作按钮 ,我想以编程方式更改图标
我试图放置两个图标,一个与 wordDocument 相关,另一个与按钮上的下载图标相关,但一个图标覆盖另一个图标,这是代码:
import { FileWordOutlined, DownloadOutlined } from '@ant-design/icons';
return (
<Fragment>
<Button
type="primary"
style={{ width: '30%' }}
onClick={() => {
authProvider.getIdToken().then(token => {
downloadFile(
`${process.env.REACT_APP_API_URL}/api/Projects/${projectNumber}`,
token.idToken.rawIdToken
);
});
}}
icon={((<FileWordOutlined />), (<DownloadOutlined />))}
size="small"
>
Basis of Design
</Button>
</Fragment>
);
Run Code Online (Sandbox Code Playgroud)
按钮图像现在看起来像这样
我希望将图标放置在文本“设计基础”<FileWordOutlined />的右侧,并放置在文本的左侧。<DownloadOutlined />
谁能告诉我有什么办法可以实现这一目标吗?
这是我的设置菜单小部件页面或代码的页面
class Setting extends StatelessWidget {
Setting(this.title);
String title;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
backgroundColor: Theme.of(context).primaryColor,
),
body: Column(
children: <Widget>[
setttingWidget(Icons.favorite),
],
)
);
}
}
Run Code Online (Sandbox Code Playgroud)
这是设置Widget页面或代码:
class setttingWidget extends StatelessWidget {
setttingWidget(IconData next);
var next;
@override
Widget build(BuildContext context) {
return Card(
child: Row(
children: <Widget>[
Icon(next),
Text("Network Setting",
style: TextStyle(
fontSize: 20
),)
],
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
我想从设置小部件设置图标图像,因此使用图标数据,但应用程序中没有出现图标,代码也没有显示任何错误。
我正在尝试向运行我的命令的“编辑器/标题”部分添加一个按钮。在我当前的配置中,通过单击 3 个按钮展开菜单时会显示我的命令名称。我想要的是显示一个运行我的命令的图标(如拆分编辑器按钮)。
从文档中我发现应该可以为图标提供 svg 文件,但我更喜欢使用产品图标中的图标。这样图标就可以随着主题而改变。
这是否可能,或者我只是配置错误?
这是我到目前为止的配置:
"contributes": {
"commands": [
{
"command": "my-extension.my-command"
"title": "My Command",
"icon": "preview" // <-- this refers to the icon from 'product icons'
}
],
"menus": {
"editor/title": [
{
"when": "resourceExtname == .xyz",
"command": "my-extension.my-command"
}
]
}
}
Run Code Online (Sandbox Code Playgroud) 我制作了一个应用程序,并实现了推送通知,它可以工作,但我尝试使用 a 更改默认图标image.png,但它没有按我预期的方式工作。这是我的通知的样子:
我希望我的图标看起来像这样:
我在我的 Android 清单中添加了以下内容:
<!-- Add custom icon to the notifications -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_notifications" />
<!-- Change the color of the icon -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/colorPrimary" />
Run Code Online (Sandbox Code Playgroud)
我不知道我做错了什么,但你能帮助我吗?
icons android push-notification flutter flutter-notification
我想在我的个人资料屏幕中创建一个带有按钮的用户个人资料照片,或者创建一些创意来更改此照片,例如谷歌:
但我现在拥有的是这样的:
CircleAvatar(
radius: 75,
backgroundColor: Colors.grey.shade200,
child: CircleAvatar(
radius: 70,
backgroundImage: AssetImage('assets/images/default.png'),
)
),
Run Code Online (Sandbox Code Playgroud)
如何添加像谷歌示例中那样的按钮?
我试图在点击时更改我的 SVG 图标颜色。我已经尝试过,selectedColor但图标没有改变颜色。所以我尝试使用快捷方式 if...else 语句,但我仍然没有改变颜色。
这是代码:
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: SvgPicture.asset('assets/dashboard-outline.svg', width: 25),
label: 'Dashboard'
),
BottomNavigationBarItem(
icon: SvgPicture.asset('assets/tank-outline.svg', color: Colors.black54, width: 30),
label: 'Tanks',
),
BottomNavigationBarItem(
icon: SvgPicture.asset('assets/activity-outline.svg', width: 18),
label: 'Activity'
),
BottomNavigationBarItem(
icon: SvgPicture.asset('assets/account-outline.svg', width: 20),
label: 'Account'
),
],
currentIndex: _index,
onTap: _onItemTapped,
selectedItemColor: Color.fromRGBO(0,99,183,1)
),
Run Code Online (Sandbox Code Playgroud)
我有一个不同的 SVG 图片图标文件,可以在点击时更改它。
这是我正在尝试的代码:
bool onSelected = true;
Widget build(BuildContext context) {
return Scaffold(
body: _myPages[_index],
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: …Run Code Online (Sandbox Code Playgroud) 这个问题似乎非常重要。但是,我在任何官方渐进式 Web 应用程序 (PWA) 文档中都找不到答案。
我的 PWA的manifest.json包含相当多的图标,甚至相当大的图标screenshot.png,这些图标对于 PWA 的核心来说并不是必需的。
{
"src": "./assets/static/images/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "./assets/static/images/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "./assets/static/images/android-chrome-512x512.maskable.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "./assets/static/images/android-chrome-192x192.maskable.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "./assets/static/images/apple-touch-icon.png",
"sizes": "180x180",
"type": "image/png",
"purpose": "maskable"
}
],
"screenshots": [
{
"src": "./assets/static/images/screenshot.png",
"sizes": "1080x2220",
"type": "image/png"
}
]
Run Code Online (Sandbox Code Playgroud)
我的单页 PWA中仅引用了上述图标之一index.html:
<link rel="apple-touch-icon" sizes="180x180" href="./assets/static/images/apple-touch-icon.png"/>
Run Code Online (Sandbox Code Playgroud)
但还有更多的图标主要用于 …
我有一个用于动态定义菜单的数据类。
data class ActionItemSpec(
val contentDescription: String,
val icon: ImageVector,
val onClick: () -> Unit
)
Run Code Online (Sandbox Code Playgroud)
我的问题是,当使用标准图标时,它可以完美地工作,但此类问题是它不能采用其他任何东西,例如自定义可绘制对象。
如何从自定义可绘制对象创建 ImageVector?你可以撰写吗?