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 1044627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:51:28+00:00 2026-05-16T15:51:28+00:00

I have an extended ImageView that I’m reusing 7 times horizontally (within a LinearLayout)

  • 0

I have an extended ImageView that I’m reusing 7 times horizontally (within a LinearLayout) across my screen. Directly above and below this ImageView are other extended ImageViews that are within their own LinearLayouts. I’m spacing these all evenly by using the weight property within the LinearLayout so they space evenly across the screen. What I need to do is have this middle ImageView be able to float on top of either the top or bottom ImageViews to which it lines up with an animation. Is there some sort of z-index I can put on elements so that I can float this middle IV above the others?

Snippet of my xml:

<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/opponentrow">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="45px"
        android:layout_height="60px"
        android:src="@drawable/topimage"
        android:layout_weight="1" />
        ...
</LinearLayout>
<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/tokenrow">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="20px"
        android:layout_height="20px"
        android:src="@drawable/centerimage"
        android:layout_weight="1" />
        ...             
</LinearLayout>
<LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
    <ImageView
        android:id="@+id/your1"
        android:layout_width="45px"
        android:layout_height="60px"
        android:src="@drawable/bottomimage"
        android:layout_weight="1" />
        ...
</LinearLayout>

the ellipses just indicate that those imageviews are repeated 7 times each. Also, they are not TRUE ImageViews as I said, they are extended.

here is a snippet for the imageview that’s in the middle (one with centerimage as its source) that does the animation (this is within the .java file)

    public Tokens(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
        setOnClickListener(myListener);
    }

    private OnClickListener myListener = new OnClickListener(){
    public void onClick(View v) {
        doAnimate();
    }
}; 

private void doAnimate(){
    final Animation animUp = new TranslateAnimation(0,0,0,-22);
    animUp.setDuration(200);
    animUp.setFillAfter(true);

    final Animation animDown = new TranslateAnimation(0,0,0,22);
    animDown.setDuration(200);
    animDown.setFillAfter(true);
    if(avail)
        startAnimation(animDown);

}

some important considerations: I need to retain the even horizontal spacing for the 7 elements (all 3 rows of them). I’m open to using a different Layout type if my objectives can’t be met with LinearLayout.

thanks for your time

  • 1 1 Answer
  • 1 View
  • 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-05-16T15:51:29+00:00Added an answer on May 16, 2026 at 3:51 pm

    I ended up writing a custom view and calling a stacked xml file with:

    View view=layoutInflater.inflate(R.layout.handlayout, this);
    

    it seems to work and actually I like this solution better anyway because I’m including all three elements (in the ‘column’) into one view.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an extended BaseAdapter that has LinearLayout children (an ImageView and a TextView
I have a view in the UI that is technically an extended ImageView inside
I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that
Hello I have an extended stored procedure that sends an error message. srv_sendmsg(pSrvProc, SRV_MSG_ERROR,
I have to open a page from class extended from javax.swing.AbstractAction class... Is that
I have extended jEditorPane as shown below (minus the instantiation code). However, when I
I am building an application that I want to have extended with modules that
I have extended the ImageView class in a class called DialButton2 (dont worry about
I have an ImageView that you can use to do a one-finger pan, or
I have extended a class that is part of a large library. I instantiate

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.