私は 2 つの画像ビューを持っており、これを垂直線形レイアウトに入れようとしています。上下に並べたいのですが、なぜか横に配置されてしまいます。これが私のコードです:
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));
何かご意見は?