【问题标题】:Flutter part of text is missing on mobile移动设备上缺少文本的颤振部分
【发布时间】:2020-10-11 16:16:41
【问题描述】:

我有一个颤振的网络应用程序。当我在我的电脑上使用它时,一切正常。但是如果我在我的手机浏览器上使用它,文本的部分就会丢失。文本或框的边界无关紧要,它只是丢失了。只有当我按下它时,它才会显示整个文本。有谁知道为什么会这样?哦,当我缩短文本时,它是一样的。最后一部分不见了。

已经尝试使用 FittedBox 作为文本,但不起作用。谢谢

alertBoxes 的代码:

void showCustomDialog(BuildContext context, String message) {
    showDialog(
        context: context,
        child: AlertDialog(
            title: FittedBox(
              fit: BoxFit.scaleDown,
              child: Text(
                message,
                style: TextStyle(color: Colors.red),
              ),
            ),
            actions: [
              FlatButton(
                onPressed: () {
                  Navigator.of(context).pop();
                },
                child: Text(
                  "Abbrechen",
                  style: TextStyle(color: Colors.red),
                ),
              ),
            ]));
  }

对话的第一部分:

Widget dialog(BuildContext context) {
    return AlertDialog(
      title: Text("Kategorie Hinzufügen?"),
      content: TextFormField(
        controller: textEditingController,
        decoration: InputDecoration(
            labelText: "Namen eingeben",
            prefixIcon: Icon(Icons.category_outlined)),
        onChanged: (String val) {},
      ),
      actions: [
        FlatButton(
          onPressed: () {
            Navigator.of(context).pop();
          },
          child: Text(
            "Abbrechen",
            style: TextStyle(color: Colors.red),
          ),
        ),

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    我修好了。显然,当我使用 DuckDuckGo 时会发生这种情况。当我使用 Chrome 时,一切都很好。但是当您使用 DuckDuckGo 时,字符串的最后一个字符或者如果您有空格,则最后一个空格后面的所有内容都会被剪切。嗯很奇怪

    【讨论】:

      【解决方案2】:

      flutter 团队刚刚将其修复在主频道(1.26.0-2.0.pre.403)上。我已经对其进行了测试,并且效果很好。可能很快它就会进入测试版。

      https://github.com/flutter/flutter/issues/65099

      【讨论】:

      • 如果可能,请提供链接作为参考。
      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 2022-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多