Я добавляю несколько изображений в линейный макет.Эти виды добавляются, а также увеличивается размер линейного макета, но эти виды не отображаются.
Вот мой код:
FrameLayout rootLayout = (FrameLayout) rowView.findViewById(R.id.frame_layout);
LinearLayout parentLayout = (LinearLayout) rootLayout.findViewById(R.id.linear_layout);
for (int i = 0; i < itemList.size(); i++)
{
Item item = itemList.get(i);
int xCoord = (int) Utils.getPosition(resizedValues.originalWidth, resizedWidth, hotSpot.getPositionX(), context);
int yCoord = (int) Utils.getPosition(resizedValues.originalHeight, resizedHeight, hotSpot.getPositionY(), context);
Utils.print("xCoord = " + xCoord + " : yCoord = " + yCoord);
ImageView imageView = new ImageView(getApplicationContext());
imageView.setImageResource(R.drawable.hotspot);
imageView.setAdjustViewBounds(true);
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
params.leftMargin = xCoord;
params.topMargin = yCoord;
params.gravity = Gravity.TOP | Gravity.LEFT
imageView.setLayoutParams(params);
Utils.print("params.leftMargin = " + params.leftMargin + " : params.topMargin = " + params.topMargin);
Utils.print("child count = " + parentLayout.getChildCount());
parentLayout.addView(imageView, i);
}
Заранее спасибо!