동적으로 이미지뷰를 만들고 이미지뷰 밑에 LinearLayout을 추가하려고 합니다만
id을 못얻는지 below가 안먹히네요... 아래는 제가 짠 소스입니다...보기쉽게 기존틀만 썼습니다...
// RelativeLayout 생성
rl[pos] = new RelativeLayout(this);
// ImageView 생성
image[pos] = new ImageView(this);
image[pos].setBackgroundColor(Color.RED);
// params 생성
RelativeLayout.LayoutParams ll_params = new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
ll_params.addRule(RelativeLayout.BELOW, image[pos].getId());
// 레이아웃 생성
linear[pos] = new LinearLayout(this);
linear[pos].setLayoutParams(ll_params);
// addView
linear[pos] .addView(image[pos]);
rl[pos] .addView(linear[pos]);
RelativeLayout 생성 -> ImageView 생성 -> LinearLayout 생성 -> LinearLayout에 ImageView 담기 -> RelativeLayout에 LinearLayout 담기
이런식으로 짰는데 LinearLayout이 ImageView 밑으로 내려가질 않네요.... 생성 순서가 문제가 있는건지....
쉽게 썼다고 썼는데 보기 어려워보이네요...ㅠㅠ 몇시간동안 막혀서 이렇게 질문올립니다 꼭좀 부탁드릴게요 ㅠ