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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:07:00+00:00 2026-06-15T12:07:00+00:00

I have two image views, which I am trying to put into a vertical

  • 0

I have two image views, which I am trying to put into a vertical linear layout. I want them to be one on top of the other, but somehow they get placed horizontally. Here’s my code:

String[] portalNiz;
Uri slika;
ImageView imgLogo = new ImageView(AllDiscounts.this);
portalNiz = c.getString(1).split("\\.");
slika = Uri.parse("android.resource://rs.jedanzasve/raw/"+portalNiz[0].toLowerCase());
imgLogo.setImageURI(slika);

Uri slikaKategorije;
ImageView imgCategory = new ImageView(AllDiscounts.this);
String categoryImage = "";
if (c.getString(14).contains("lepota")) categoryImage = "lepota";
if (c.getString(14).contains("odmor")) categoryImage = "odmor";
if (c.getString(14).contains("putovanja")) categoryImage = "putovanja";
if (c.getString(14).contains("ostalo")) categoryImage = "ostalo";
if (c.getString(14).contains("proizvodi")) categoryImage = "proizvodi";
if (c.getString(14).contains("sport")) categoryImage = "sport";
if (c.getString(14).contains("hrana")) categoryImage = "hrana";
if (c.getString(14).contains("bioskopi")) categoryImage = "bioskopi";
if (c.getString(14).contains("zdravlje")) categoryImage = "zdravlje";
slikaKategorije = Uri.parse("android.resource://rs.jedanzasve/raw/"+categoryImage.toLowerCase());
imgCategory.setImageURI(slikaKategorije);

LinearLayout vertikalniSlike = new LinearLayout(AllDiscounts.this);
vertikalni.setOrientation(LinearLayout.VERTICAL);

vertikalniSlike.addView(imgLogo, new LinearLayout.LayoutParams(                     LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));

vertikalniSlike.addView(imgTest, new LinearLayout.LayoutParams(                     LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));

Any thoughts?

  • 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-15T12:07:01+00:00Added an answer on June 15, 2026 at 12:07 pm

    You have added the imageViews to vertikalniSlike LinearLayout but you have set orientation to verticalni layout. Unless is the typo. Please replace:

    vertikalni.setOrientation(LinearLayout.VERTICAL);
    

    with

    vertikalniSlike.setOrientation(LinearLayout.VERTICAL);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a layout that contains two ImageViews. I want one of them to
I have two ImageViews which contain the same image. The Views are located in
I have a ScrollView which has two hidden images, one at the top and
I have two ImageViews, one called imageView and the other called subView (which is
Right now, I have a layout that looks like one of the two images
I have been trying to update two UIImageView elements almost simultaneously. Whilst one should
I'm trying to create an animation to transition between two views, both of which
I am trying to add two UIScrollView 's into one UIView , Both the
I have a activity where I have two imageViews. In onTouch I recognize which
In my xml file, I have declared two imageview and later I add image

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.