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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:33:39+00:00 2026-05-21T18:33:39+00:00

I have some Popups on my screen, and need something not so common. I

  • 0

I have some Popups on my screen, and need something not so common.

I Layout my popup with Header + Content + Footer into a LinearLayout. But I need a little arrow to show on my component.

When the popup is above the anchor and the arrow is down, I use the following code to have it drawed.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/content" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_height="wrap_content">

<LinearLayout android:id="@+id/header" android:background="@drawable/background_header"
    android:orientation="horizontal" android:layout_width="match_parent"
    android:layout_height="wrap_content">
</LinearLayout>

<HorizontalScrollView android:background="@drawable/background"
    android:layout_width="wrap_content" android:layout_height="match_parent"
    android:scrollbars="none">

</HorizontalScrollView>

<ImageView android:id="@+id/arrow_down" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:layout_marginTop="-3dip"
    android:src="@drawable/quickcontact_arrow_down" />
</LinearLayout>

In runtime I’m able to place the arrow exactly above the anchor with the following code.

    ViewGroup.MarginLayoutParams param = (ViewGroup.MarginLayoutParams) mArrowDown
            .getLayoutParams();
    param.leftMargin = root.getMeasuredWidth()
            - (screenWidth - anchor.getLeft());

And it’s show correctly.

Now I need do the same thing but the arrow needs to show in the up side.
My problem is that the arrow need overlap a little over the other View (cause the backgrounds color match them), so this is why it’s need to be draw after.

I tried with a FrameLayout and letting “content” has some topMargin, but it’s not working.

I know it’s can be done with AbsoluteLayout, but I’m avoiding it at all costs.

EDIT:

Following Josh answer, I wrote the following code.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<LinearLayout android:id="@+id/content"
    android:orientation="vertical" android:layout_width="wrap_content"
    android:layout_height="wrap_content" android:fadingEdgeLength="0dip">

    <RelativeLayout android:id="@+id/header"
        android:background="@drawable/background_header" android:orientation="horizontal"
        android:layout_width="match_parent" android:layout_height="wrap_content">
    </RelativeLayout>

    <HorizontalScrollView android:background="@drawable/background"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:scrollbars="none">
    </HorizontalScrollView>
</LinearLayout>
<ImageView android:id="@+id/arrow_up" android:layout_above="@id/content"
    android:layout_width="wrap_content" android:layout_height="wrap_content"
    android:src="@drawable/quickcontact_arrow_up" />
</RelativeLayout>

But I don’t know why, the arrow is not show now.

  • 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-21T18:33:40+00:00Added an answer on May 21, 2026 at 6:33 pm

    I won’t pretend to have read all that xml. I think what you want is RelativeLayout, though. You should be able to use this technique to place any little arrow view where ever you like, relative to the bounds of the RelativeLayout which encompasses it.

    If you wrap everything you have in a single RelativeLayout, for instance, and then add, say, a Button as the second item, you can give the button attributes like alignParentRight=true and layout_marginRight=10dp to place the button 10dp from the right edge of the screen, ON TOP of whatever views are already there.

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

Sidebar

Related Questions

I have some markup for a popup menu that works in firefox but not
I have a modal popup that initially shows some content but expands a div
I have three DIVs, something like this: <div id=header> ... </div> <div id=content> <div
I have some code that popups a message box: MessageBox.Show(this, You have not inputted
I have some problem with my open new window popup which it can read
I have an asp.net web page written in C#. Using some javascript I popup
I have a form, user enters some data then submits. Rather than a popup
I have some perl code that looks something like this: my @array = map
Have a question regarding something which has been bugging me for some time now.I'm
I have a jqgrid in a modal popup that has data dependent on some

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.