我刚刚开始拍打,在这里我很困惑如何增加间距。
请帮帮我。
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.N_MR1) {
Intent shortcutIntent = new Intent(getApplicationContext(), SplashScreen.class);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
shortcutIntent.setAction(Intent.ACTION_MAIN);
ShortcutInfoCompat shortcut = new ShortcutInfoCompat.Builder(getApplicationContext(), "shortcut")
.setShortLabel(getResources().getString(R.string.app_name))
.setIcon(IconCompat.createWithResource(getApplicationContext(), R.mipmap.apt_launcher))
.setIntent(shortcutIntent)
.build();
ShortcutManagerCompat.requestPinShortcut(getApplicationContext(), shortcut, null);
}
答案 0 :(得分:1)
使用IconButton
代替Icon
。
appBar: AppBar(
title: Text('Breeds of Dogs'),
automaticallyImplyLeading: false,
actions: <Widget>[
IconButton(
icon: Icon(
Icons.add_a_photo,
color: Colors.white,
),
onPressed: () {}),
],
),
答案 1 :(得分:0)
使用图标按钮代替icon
appBar: AppBar(
title: Text('Breeds of Dogs'),
actions: <Widget>[
IconButton(
icon: Icon(
Icons.add_a_photo,
),
onPressed: () {
print("Hello");
}),
],
)