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

  • Home
  • SEARCH
  • 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
  • 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-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 a C++ Windows application that can be extended by writing C++ plugins,
Is there a way to write an enumeration that can be extended. I have
I have extended the ASP.NET MVC Html Helper to include my own ValidationImage that
I have extended jEditorPane as shown below (minus the instantiation code). However, when I
I have an extended dialog class that I want to show for 3 seconds
I have a SharePoint site extended for forms authentication. The Active Directory site is
I have a FBA website and then I extended it (to use Windows Authentication)
I have 2 classes, main and extended. I need to use main vars in
I have an extender control that raises a textbox's OnTextChanged event 500ms after the
I have a simple extender component that draws 3D borders around any Control. In

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.