Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Android GridView不完美,如何删除额外的空白区域大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一个基于GridView的日历.我有以下 XML布局,选择器设置为null,因此android:listSELEctor =“@ null”根据我从这个网站获得的建议.现在我在GridView的右边有一些像素宽的条带.为什么?我已经尝试了所有我能做到的但是有用的.这是我的XML布局:
<LinearLayout xmlns:android="http://scheR_984_11845@as.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="match_parent"
            android:orientation="vertical" >

            <GridView
                android:id="@+id/calendar"
                android:layout_width="fill_parent"
                android:layout_height="match_parent"
                android:horizontalSpacing="-1px"
                android:numcolumns="7"
                android:stretchMode="columnWidth" 
                android:gravity="center"
                android:verticalSpacing="-1px"
                android:listSELEctor="@null" >

            </GridView>

        </LinearLayout>

我得到的是这张照片:

解决方法

此空间是由于网格的每一行计算不完善所致.
例如,您的设备宽度为320像素,您有7行,请尝试任何符合320像素的计算.如果每个单元格的宽度是45.71428571428571 px,那么只有它可以减少.

其他选择

应用机器人:比重=“中心”你网格中的属性,以便空格从左到右平分

大佬总结

以上是大佬教程为你收集整理的Android GridView不完美,如何删除额外的空白区域全部内容,希望文章能够帮你解决Android GridView不完美,如何删除额外的空白区域所遇到的程序开发问题。

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

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。