gpt4 book ai didi

dart - flutter : Where is the title of Material App used?

转载 作者:IT老高 更新时间:2023-10-28 12:29:15 28 4
gpt4 key购买 nike

flutter 应用名称包名显示,AppBar标题显示在首页的AppBar ,那么标题MaterialApp(title: 'Rectangle App',);在哪里用在flutter项目中。

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Rectangle App',
home: Scaffold(
appBar: AppBar(
title: Text('Rectangle App Home Page'),
),
body: HelloRectangle(),
),
);
}
}

最佳答案

这是个好问题。下面是它的使用说明:

A one-line description used by the device to identify the app for the user.

On Android the titles appear above the task manager's app snapshots which are displayed when the user presses the "recent apps" button. Similarly, on iOS the titles appear in the App Switcher when the user double presses the home button.

简而言之:

  • 在 Android 上:用于最近的应用程序

  • iOS:应用切换器中使用

2020 年 2 月 11 日更新:

文档更新了(具体更新时间我不知道)

A one-line description used by the device to identify the app for the user. On Android the titles appear above the task manager's app snapshots which are displayed when the user presses the "recent apps" button. On iOS this value cannot be used. CFBundleDisplayName from the app's Info.plist is referred to instead whenever present, CFBundleName otherwise. To provide a localized title instead, use [onGenerateTitle].

所以这个值对iOS没有影响

关于dart - flutter : Where is the title of Material App used?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50615006/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com