2011-02-06 3 views

답변

52

레이아웃이 RelativeLayout이고 다른 ViewGroup이 alignParentBottom을 인식하지 못하는 경우에만 작동합니다.

RelativeLayout layout = findViewById(R.id.my_relative_layout); 
Button button = new Button(this); // your button 
lp = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); // You might want to tweak these to WRAP_CONTENT 
lp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM); 
layout.addView(button, lp); 
+0

감사합니다. 그것은 매력처럼 작동합니다! –

+1

당신을 진심으로 환영합니다. 그 대답을 받아들이는 것을 잊지 마세요, 누프 씨. –

관련 문제