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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:32:51+00:00 2026-06-08T19:32:51+00:00

i try to create popupWindow with preView where user can see images from gallery.

  • 0

i try to create popupWindow with preView where user can see images from gallery.
But first and second images are hiden and at the end of scrollView is empty space like in a screenshot.

enter image description here

I am try to use
layout.addView(imageView);

private void showAttachmentPopup() {
    LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View popupView = layoutInflater.inflate(R.layout.attachemnts_file_popup, null, false);
    PopupWindow pw = new PopupWindow(popupView, LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT, true);
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
    params.addRule(RelativeLayout.BELOW, findViewById(R.id.layout_sent).getId());
    popupView.setLayoutParams(params);
    LinearLayout layout_attachment = (LinearLayout) popupView.findViewById(R.id.layout_attachment);
        RoundedImageView roundedImageView = new RoundedImageView(this);
        LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, Gravity.CENTER);
        lp.setMargins(5, 5, 5, 5);
        roundedImageView.setLayoutParams(lp);
        roundedImageView.setScaleType(RoundedImageView.ScaleType.FIT_XY);
        roundedImageView.setImageBitmap(bitmap);
        layout_attachment.addView(roundedImageView);

    pw.setOutsideTouchable(true);
    pw.setBackgroundDrawable(new BitmapDrawable());
    pw.showAtLocation(mBtnAttach, Gravity.BOTTOM | Gravity.LEFT, locateView(mBtnAttach).bottom, locateView(mBtnAttach).right);
}

And if I try to add this bitmap few time this error happens.
In my xml just HorizontalScrollView and LinearLayout into here

  • 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-08T19:32:53+00:00Added an answer on June 8, 2026 at 7:32 pm

    I ( guess ) i had the same issue, looked the same.

    What helped me out was to set adjustViewBounds:

    roundedImageView.setAdjustViewBounds(true);
    

    Hope it suits your case!

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

Sidebar

Related Questions

I try to create styles with first-child and last-child items but I encountered a
I'm trying to show a ListView from a PopupWindow. but when I'm try to
I try create a map for open ~/.vimrc, but open the ~/.vimrc only when
I try to create a thread in QT, can declare, create and start it,
snippet from The Server code : public void run() { try { // Create
I try create two moving object from one class. I want to control they
I'll try create a controler in towerjs, but I have an error while updating
I to try create my first javascript app with backbone.js And I found strange
I have specific troubles when I try create node. From context menu everything gona
i try create my first android application for android 2.1 api level 7 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.