에 표시되지 않습니다 부풀려 나는 내 문제는, 뷰 그룹을 확장하여 customed보기를 만든 비정상적보기, 하위보기가 표시되지 않습니다. 자식보기가 하드 코드보기 (예 : btn = new Button (ctx)) 일 때 표시됩니다!안드로이드 : 아이 (addView (chileView)) 뷰 그룹에 뷰를 추가 할 때</p>이 가, 아이 뷰가 있습니다 <p> 경우 : customed 뷰 그룹
강령, 표시하지 :
public class EdgeSwiper extends ViewGroup{
public EdgeSwiper(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init(context);
}
public EdgeSwiper(Context context, AttributeSet attrs) {
super(context, attrs);
init(context);
}
public EdgeSwiper(Context context) {
super(context);
init(context);
}
View v;
private void init(Context context) {
v = View.inflate(context,R.layout.aview,null);
this.addView(v);
}
@Override
protected void onLayout(boolean arg0, int a, int b, int c, int d) {
v.layout(a, b, c, d);
}
}
문제가있는 코드를 게시 할 수 있습니까? – Don