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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:51:14+00:00 2026-05-23T21:51:14+00:00

On Android, I am trying to create a dynamic image viewer that flip images

  • 0

On Android, I am trying to create a dynamic image viewer that flip images and at the bottom of each image I display some information about the image,1 or 2 lines of text max. I want to give the area that displays the text a unique background color to let it stand up. Everything works fine with the exception of one thing, when I set a color for TextView to let say “Black” I get the entire screen black covering the image image! and not only the TextView area. Please bear in mind that I create everything dynamically as I am doing below:

imageFrame = new FrameLayout(this);

Viewer = new ImageView(this);

imageInfo = new TextView(this);
imageInfo.setHeight(imageInfo.getLineHeight()); imageInfo.setGravity(Gravity.BOTTOM);
imageInfo.setBackgroundColor(Color.CYAN);
imageFrame.addView(Viewer);
imageFrame.addView(imageInfo);

Any help is appreciated

  • 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-23T21:51:14+00:00Added an answer on May 23, 2026 at 9:51 pm

    You might want to set the height and width dynamically as well. My guess is the textview width and height are set to fill_parent. If that doesn’t work try adding the elements to the imageFrame in a different order.

    Below is how you need to set the widths dynamically for each textview.

    TextView tv = (TextView) findViewById(R.id.yourtextviewname)
    ViewGroup.LayoutParams vg1 = (ViewGroup.LayoutParams) tv.getLayoutParams();
    vg1.width = 100;
    
    tv.setLayoutParams(vg1);
    

    Also try making a linear layout the root element inside your frame layout. Then put the textview and image view in the linear layout.

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

Sidebar

Related Questions

I am trying to create a simple Android application that has a ActivityList of
I'm trying to create an app for Android that simply sends a command to
I'm trying to create an application for Android that uses encryption to save user
I am currently trying to create an Android application that loops Audio from the
I'm trying to create an Android app that searches for a certain type of
I'm trying to create a simple Android UI that consists of a EditText and
I'm trying to create standard button in android with a background and some text
I'm trying to create a dynamic icon menu for my android application. The icon
When I am trying to create a dynamic instance of Android UI Component, it
I'm trying to create a dynamic ItemizedOverylay (please see the code below) on Google

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.