GridLayout-垂直水平约束不一致

GridLayout-垂直水平约束不一致,第1张

概述我之所以发布此信息,是因为我无法在SO和网络的其余部分中找到确切的信息.我看了this,但我不确定如何解决问题.当我在应用程序中使用GridLayout时出现了问题,每当旋转屏幕时,都会看到类似以下的输出:在横向模式下:06-2321:41:25.62710222-10222/in.cryf.yacaD/android.widget.G

我之所以发布此信息,是因为我无法在SO和网络的其余部分中找到确切的信息.我看了this,但我不确定如何解决问题.

当我在应用程序中使用GrIDLayout时出现了问题,每当旋转屏幕时,都会看到类似以下的输出:

在横向模式下:

06-23 21:41:25.627 10222-10222/in.cryf.yaca D/androID.Widget.GrIDLayout: vertical constraints: y1-y0>=112, y2-y1>=112, y3-y2>=112, y4-y3>=112, y4-y0<=311 are inconsistent; permanently removing: y4-y0<=311.

在纵向模式下:

06-23 21:41:28.124 10222-10222/in.cryf.yaca D/androID.Widget.GrIDLayout: horizontal constraints: x1-x0>=192, x2-x1>=192, x3-x2>=192, x4-x3>=192, x4-x0<=704 are inconsistent; permanently removing: x4-x0<=704.

尽管它不会影响我的应用程序的运行,但从我上面发布的SO链接看来,它可能会出现性能问题.

我的XML中的GrIDLayout:

<GrIDLayout        androID:ID="@+ID/button_grID"        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content"></GrIDLayout>

除此之外,创建我的应用程序时,我会以编程方式向布局添加视图.

解决方法:

将GrIDLayout封装在ScrollVIEw中之后,该消息不再出现.

<ScrollVIEw        androID:layout_below="@ID/output"        androID:layout_wIDth="match_parent"        androID:layout_height="wrap_content">    <horizontalscrollview        androID:layout_wIDth="wrap_content"        androID:layout_height="wrap_content">        <GrIDLayout            androID:ID="@+ID/button_grID"            androID:layout_wIDth="wrap_content"            androID:layout_height="wrap_content">        </GrIDLayout >    </horizontalscrollview></ScrollVIEw>
总结

以上是内存溢出为你收集整理的GridLayout-垂直/水平约束不一致全部内容,希望文章能够帮你解决GridLayout-垂直/水平约束不一致所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1120798.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存