gpt4 book ai didi

Android gridlayout 溢出屏幕

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:21:40 25 4
gpt4 key购买 nike

我有这个代码:

<?xml version="1.0" encoding="utf-8"?>

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:columnCount="8"
android:rowCount="8" >

<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />
<ImageButton
android:src="@android:drawable/ic_menu_rotate"
android:contentDescription="@null" />

</GridLayout>

它给了我这个:

enter image description here

它应该是一个 8x8 的网格,但它溢出了。我如何以非编程方式(通过 xml)适合 64 个正方形?

最佳答案

您可能还想查看 http://daniel-codes.blogspot.com.au/2012/01/gridlayout-view-clipping-issues.html

这是该页面的关键信息,以防它被删除:

在最后(最右边) View 中使用以下内容

    android:layout_width="0dip"
android:layout_gravity="fill_horizontal"

关于Android gridlayout 溢出屏幕,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19701744/

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