我正在为我的应用程序仪表盘使用 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/