如何解决Android Studio GridView 吹屏边框
首先,我希望您度过了一个愉快的假期和有趣的新年前夜,尽管发生了大流行。
我正在开发一个应用程序作为项目的一部分。但是我似乎对 GridView 有一些问题。 当我用物品给它充气时,它会超出屏幕的边界。 This is when scrolled the top. As you can see the top of the GridView is beyond the borders of the screen. This is when scrolled to the bottom. As you can see the bottom of the GridView is also beyond the borders of the screen. 我认为它可能与底部的导航栏片段有关。在 XML 中,它们都定义如下:
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnWidth="100dp"
android:numColumns="1"
android:stretchMode="columnWidth"
app:layout_constraintBottom_toTopOf="@id/nav_bar_container"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:verticalSpacing="10dp"
/>
<LinearLayout
android:id="@+id/nav_bar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
</LinearLayout>
我的 GridView 充气器的工作原理如下:
if (gridView == null) {
LayoutInflater inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
gridView = inflater.inflate(R.layout.profile_friend_item,null);
}
不知道有没有人试过这个问题,但希望有人能够提供帮助。
最好的问候 瑟尔
PS:生成的配置文件范围为 [0-9],如果您需要更多详细信息,请联系我。我会很高兴地分享它们。 :)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。