Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8456071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:27:09+00:00 2026-06-10T12:27:09+00:00

I am stuck at gridview. I want an imageview below Gridview to handle click

  • 0

I am stuck at gridview.
I want an imageview below Gridview to handle click event of that.
Basically what i need is when click on this imageview button(here imageView_uparrow) it will slide up the layout which contains this gridview,
but when I add imageview(imageView_uparrow) below gridview(imageView_uparrow) in xml and run the project; gridview repeats that imageview on every grid icon.
I want that imageview to be appeared once at the bottom. Here is my XML.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="top" >

    <GridView
        android:id="@+id/inside_gridView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="50dp"
        android:layout_marginLeft="14dp"
        android:layout_marginRight="14dp"
        android:layout_marginTop="58dp"
        android:alpha="0.1"
        android:background="#696969"
        android:columnWidth="10dp"
        android:gravity="center"
        android:numColumns="3"
        android:padding="4dp"
        android:scrollbars="vertical"
        android:stretchMode="columnWidth" >
    </GridView>

    <ImageView
        android:id="@+id/image_insidegrid"
        android:layout_width="60dp"
        android:layout_height="60dp"
        android:layout_margin="5dp"
        android:contentDescription="@string/hello_world" />

    <ImageView
        android:id="@+id/imageView_uparrow"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="22dp"
        android:layout_marginRight="20dp"
        android:contentDescription="@string/hello_world"
        android:src="@drawable/drop_down_top_arrow" />

</RelativeLayout>

Last imageview i.e imageView_uparrow keep on repeating with the gridview items.
Please help me with this.. Thanks in advance.!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:27:10+00:00Added an answer on June 10, 2026 at 12:27 pm

    Hey I got the solution..
    i kept my imageView_uparrow in separate xml and image which i used to set as an icon of my grid separate xml.And just inflated and added that to the Layout.

    My modified Grid Xml is here

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_gravity="top"
        android:id="@+id/parentRel"
        >
    
        <GridView
            android:id="@+id/inside_gridView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="50dp"
            android:layout_marginLeft="14dp"
            android:layout_marginRight="14dp"
            android:layout_marginTop="42dp"
            android:background="@drawable/transperant_background"
            android:gravity="center"
            android:numColumns="3"
            android:padding="0dp"
            android:scrollbars="vertical"
             >
        </GridView>
    
    </RelativeLayout>
    

    This is my xml file for ImageView(imageView_uparrow).

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/layout_up_arrow_for_gridView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
    
        <ImageView
            android:id="@+id/imageview_up_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="14dp"
            android:contentDescription="@string/app_name"
    
             />
    
    </RelativeLayout>
    

    Code i use to inflate

    Context context;
    RelativeLayout rel;
    ImageView upArrowImage;
    
    LayoutInflater inflator = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    
    
    
    
    
            context=this;
        View grid2;
    
        rel=(RelativeLayout)findViewById(R.id.parentRel);
    
        animate = AnimationUtils.loadAnimation(this, R.anim.slide_up);
        animate.setAnimationListener(this);
    
    
    
        LayoutParams lp = new LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
        lp.setMargins(14, 400, 0, 20);
    
    
    
        grid2=new View(context);
        grid2=inflator.inflate(R.layout.gridview_up_arrow_button,null);
    
        upArrowImage=(ImageView)grid2.findViewById(R.id.imageview_up_arrow);
    
        ((ViewGroup)upArrowImage.getParent()).removeView(upArrowImage);
    
        rel.addView(upArrowImage);
        upArrowImage.setImageResource(R.drawable.drop_down_arrow4);
        upArrowImage.setLayoutParams(lp);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im stuck with this little project in C# but basically my problem is this:
Got stuck here: http://jsfiddle.net/UFkg8/ Right now the animation is top-down. What do I need
I want to use jQuery with a GridView which contains textboxes, but I'm stuck
I want to create a GridView that displays records for PDF Files. These records
I am stuck here. I have a GridView with another GridView (As A Template
Been stuck on this for ages. Currently learning Django and done some bits on
Kinda stuck here... I have an application with lets say 5000 rows of data
im stuck with a problem im basically trying to create a function where I
I'm stuck on a the type of trigger needed to for this constraint. I
I have a gridview which has an asp image-button for deleting a row. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.