如何解决Flutter:将文本小部件调整为父级,没有不需要的字体填充
我正在尝试将两个文本居中,并且 T 文本从父文本中获得尽可能多的高度,因此唯一剩余的空间将是容器的填充。
代码:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.altoida.ar,PID: 17559
g.a.a.a.a.a.b: Provider com.bea.xml.stream.MXParserFactory not found
at g.a.a.a.a.a.c.e(SourceFile:72)
at g.a.a.a.a.a.c.c(SourceFile:176)
at g.a.a.a.a.a.c.b(SourceFile:92)
at g.a.a.a.a.a.i.newInstance(SourceFile:136)
at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(SourceFile:97)
at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(SourceFile:85)
at com.fasterxml.jackson.dataformat.xml.XmlFactory.<init>(SourceFile:82)
at com.fasterxml.jackson.dataformat.xml.XmlMapper.<init>(SourceFile:46)
at o.a.a.a.w.c.q.e(SourceFile:144)
at pl.kipertech.altoida.adps.tests.ar.introduction.bit.BitIntroductionFirstviewmodel.i(SourceFile:24)
at pl.kipertech.altoida.adps.tests.ar.introduction.bit.BitIntroductionFirstFragment.S0(SourceFile:66)
at androidx.fragment.app.Fragment.r1(SourceFile:2987)
at d.o.b.t.f(SourceFile:546)
at d.o.b.t.m(SourceFile:282)
at androidx.fragment.app.FragmentManager.b0(SourceFile:2189)
at androidx.fragment.app.FragmentManager.W0(SourceFile:2106)
at androidx.fragment.app.FragmentManager.Y(SourceFile:2002)
at androidx.fragment.app.FragmentManager$g.run(SourceFile:524)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
正如您在屏幕截图中看到的,T 文本中有不需要的填充:
解决方法
要实现最大可能的文本大小,您可以尝试以下操作:
- 为容器添加固定大小。
- 将文本作为子项添加到容器中。
- 现在用灵活的小部件包裹文本。
- 现在提供一些大数字作为文本的字体大小。
让我知道这是否有效。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。