android - 单击时显示阴影的 Gridview 项目

标签 android gridview android-imageview

我正在为我的应用程序仪表盘使用 gridview,但是当我单击 项目时,它会显示阴影。我怎样才能删除 click 上的 showdow。

这是我的项目网格 xml

    <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/dashboard_icon_img"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="0dp"
        android:layout_marginTop="10dp"
        android:scaleType="fitXY" />

    <TextView
        android:id="@+id/launcher_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:textSize="12sp" />

</LinearLayout>

这是我的 gridview 布局。

    <RelativeLayout 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.tech.reader.MainActivity$PlaceholderFragment" >

 <GridView

     android:id="@+id/dashboard_grid"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_centerInParent="true"
     android:layout_margin="10dp"
     android:layout_marginTop="80dp" 
     android:numColumns="3" />    
</RelativeLayout>

我在这里附上了点击模式下我的仪表板的链接图片,我试图在其中解释我的问题。 dashboard

最佳答案

在 XML 布局文件的 GridView 元素中使用 android:listSelector="#00000000"

引用 at this post

关于android - 单击时显示阴影的 Gridview 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31389760/

相关文章:

java - 如何创建一个位于 android 项目之外的 java 包

c# - 检查是否在 gridview 中修改了行

html - ASP.NET:GridView 在 HTML 表格中的背景也改变颜色(鼠标悬停)

android - 拖放 imageview android

java - ImageView 未以线性布局显示(android)

java - 如何获取 Canvas 顶部和底部的引用以进行动态定位?

java - 连接表 sqlite android

android - 检查 NavDestination 是否代表 DialogFragment

Android:从 AlertDialog onClick 外部传递变量

listview - ArrayAdapter getView() 没有被调用