Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TextView在其中一个GridView列中重叠_Java_Android_Sqlite_Gridview_Textview - Fatal编程技术网

Java TextView在其中一个GridView列中重叠

Java TextView在其中一个GridView列中重叠,java,android,sqlite,gridview,textview,Java,Android,Sqlite,Gridview,Textview,我用从本地SQLite数据库检索的Textview值填充Gridview。基本上,我实现的是,一旦电影项目被标记为收藏夹,它们就会被推送到数据库中 但是如果内容不在一行中,文本视图就会相互重叠 然而,更奇怪的是,如果长内容(需要2行或更多行)位于右侧(即,它们位于数据库表的偶数行中),那么它们工作正常 我的观点是: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="

我用从本地SQLite数据库检索的Textview值填充Gridview。基本上,我实现的是,一旦电影项目被标记为收藏夹,它们就会被推送到数据库中

但是如果内容不在一行中,文本视图就会相互重叠

然而,更奇怪的是,如果长内容(需要2行或更多行)位于右侧(即,它们位于数据库表的偶数行中),那么它们工作正常

我的观点是:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"

tools:context="com.example.p1.MainActivity$MostPopular">

<GridView
    android:id="@+id/griview_toprated"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:numColumns="auto_fit">

</GridView>

</LinearLayout>

和文本视图:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/checkTextView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center"/>

</LinearLayout>


我已经搜索了很多,玩的项目高度,宽度匹配家长,包装内容,但找不到任何解决方案

尝试将android:numColumns=“auto_-fit”更改为android:numColumns=“2”之前尝试过,但无效。gridview无法处理大小不均的左右项目,请将textview限制为最多3或4行添加到textview@AnupDasari不行!它显示了一条警告,即inputType不应与将元素类型更改为一起使用。顺便说一句,它不应该是编辑文本!尝试将android:numColumns=“auto_-fit”更改为android:numColumns=“2”之前尝试过,但无效。gridview无法处理大小不均的左右项目,请将textview限制为最多3或4行添加到textview@AnupDasari不行!它显示了一条警告,即inputType不应与将元素类型更改为一起使用。顺便说一句,它不应该是编辑文本!