【问题标题】:Gridview item showing shadow on clickGridview 项目在单击时显示阴影
【发布时间】:2015-10-02 02:16:24
【问题描述】:

我正在为我的应用程序仪表板使用gridview,但是当我在项目上click 时,它会显示阴影。我如何删除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

【问题讨论】:

  • 尝试将 GridView 上的 list_selector 属性设置为透明色:android:listSelector="#00000000"

标签: android gridview android-imageview


【解决方案1】:

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

参考at this post

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多